Hacker News new | past | comments | ask | show | jobs | submit | outlore's comments login

is there any good solution for chrome extensions? clerk has a chrome SDK but documentation is sparse and OTP/vertification codes are not dispatched inside an extension popup for some reason.

I'm using Firebase Auth with a Chrome extension.

There is an API to `signInWithCustomToken`[0] that makes it fairly straightforward to do from your client script.

The way I have it set up is:

    - User clicks the Login action and is redirected to an app page which redirects to OAuth login
    - User performs normal signup/login flow via the OAuth login and redirects back to the app page
    - In my case, it is an SPA and I generate a custom token on the server side using the FirebaseAdmin SDK and write it to the page as a hidden `<div/>`
    - The extension has a client script that loads for this page looking for this `<div/>`; when it shows up, it stores the token via the background worker
    - User goes back to where ever the extension is loaded; now you can check with the background worker to see if it has a custom token and then use it to swap for an auth token
This only has to be done one time so it's not too onerous and quite seamless once you've set it up. This worked best for me since there are no restrictions once you can redirect to an app page for login and you don't have to fiddle around with figuring out the restrictions in Chrome extensions.

Example of this flow in an extension: https://chromewebstore.google.com/detail/turasapp/lpfijfdbgo...

[0] https://cloud.google.com/identity-platform/docs/reference/re...


I use Firebase SDK with the FirebaseUI library on languagereactor.com. When users access the /login page, if the extension is detected, the signInSuccessWithAuthResult callback triggers getFirebaseSignInToken to obtain a custom token. This token is then passed to the Firebase SDK running in the extension’s background worker via messaging, where signInWithCustomToken() is called. The SDK in the background worker has an onAuthStateChanged() callback that notifies any listening tabs when the authentication state changes.

However, some users had been reporting issues related to third-party cookies and a few other minor problems. Recently, oeffectively running a 'DROP TABLE' on 400GB of Firestore data ended up costing $2,000.

I'm looking for an auth replacement. 2 million users, mostly free users. The system needs to support Google sign-in and email authentication, possible to integrate with React Native Expo, ability to issue API keys (thats probably separate). No vendor lock-in, under $500/month, happy to self-host. Any recommendations appreciated.


    > However, some users had been reporting issues related to third-party cookies and a few other minor problems. Recently, oeffectively running a 'DROP TABLE' on 400GB of Firestore data ended up costing $2,000
This doesn't sound like an issue with Firebase Auth per se. You can still use the auth and move your storage to some other mechanism (one friend working on another project is using Firbase Auth with Supabase backend because he couldn't get Supabase auth to work with Claude generating most of his code).

In your case, depending on the document size vs number of documents, it might have been more economical to queue the deletions so that each day, you use exactly up to the free limit (20k deletes per day) and delete it over a number of days if there were no other constraints.


We have a new major version of the chrome extension sdk with a docs overhaul on the verge of release over here at Clerk if that’s useful!


I find it humorous that the men’s winner defends himself by stating that he has been practicing for decades, yet loses in the mixed final to someone who had only taken up the sport last year.

As an aside, i would love “stickied” preferences for Kagi e.g. results from the last year, with forums selected. since i’m mostly doing reddit searches anyway

you can stream the response in chunks of size N + K overlap and run the guardrails on each chunk.

There is no such thing as birds. Winged creatures? Utter fantasy. There, I said it.

https://en.m.wikipedia.org/wiki/Birds_Aren%27t_Real


i’ve been looking for a Tanstack Query style library that is backed by Sqlite (backed by OPFS or some other browser storage) and syncs with an API in the background. Does anything like that exist? i’ve seen ElectricSQL and other sync engines but they are a bit opinionated. I’m pretty new to local-first but i feel like the developer ergonomics are not quite there yet

Meanwhile for “local-only” it would be great to use sqlite in the browser + native file system API so that the db could be stored on the user’s file system and we wouldn’t have to worry about browser storage eviction. i think that could really open up a whole world of privacy preserving offline software delivered through the browser


I have working to replicate TanStack query experience by writing my own queries wrapped around PowerSync, although actually on Flutter (using Flutter Hooks! which was cool to use coming from React). It’s a very internal design meant for my app tetr[1] right now (and actually being migrated over from Realm). I am hoping to potentially standardize it and publish a package once it’s mature enough but not too wrap to make your own hooks around them for your needs.

[1] https://tetr.app


very cool product page!

thank you!

Not sure if you've looked at PowerSync yet: https://www.powersync.com/ (I'm on the team)

For the read path it hooks into Postgres logical replication or MongoDB change streams (and MySQL binlog soon). It supports partial syncing using declarative rules. For the write path, it allows writing to the local SQLite database and also places writes into an upload queue, and then uses a developer-defined function to upload writes to the backend API.

We did a deep dive on current options for SQLite on the web, and are currently using an IndexedDB-based VFS, and looking to move to OPFS: https://www.powersync.com/blog/sqlite-persistence-on-the-web

We recently released an integration with TanStack Query to allow leveraging some of its features in conjunction with PowerSync: https://docs.powersync.com/client-sdk-references/js-web/java...

> Meanwhile for “local-only” it would be great to use sqlite in the browser + native file system API so that the db could be stored on the user’s file system and we wouldn’t have to worry about browser storage eviction. i think that could really open up a whole world of privacy preserving offline software delivered through the browser

Agreed. This is a limitation of IndexedDB and OPFS as persistent browser storage currently


ooo i haven’t! will check PowerSync out :)

I've made just this!

Docs for it: https://www.triplit.dev/docs/frameworks/tanstack-router#exam...

It by default uses IndexedDB but can also use SQLite but does real time, relational querying and (optionally) syncs with you server.

Re: developer ergonomics, this is our primary focus so I don't love to get your feedback on!


thanks for sharing! will take a look :)

ElectricSQL and friends seem to be the best option so far, but they all come with a lot of caveats. It feels like local-first is near, and it's so tantalizing, but I haven't seen anything that feels like it's done enough to build on just yet.

The “type User =“ statement creates a TypeScript type from the zod schema, which can be useful when passing that definition around to functions

The schema object is useful for runtime validation, e.g. User.parse(). this is handy when validating payloads that come over the wire that might be untrusted. the output of the “parse()” function is an object of type User

you can kind of think of it like marshaling Json into a struct in Go :)


It was still the right call for the consumer though. Otherwise we’d see it become another enshittified creative cloud product.


"To provide the best experience during our transition to Adobe, Figma users will now be required to download and install Adobe Update Manager native application running 24/7 with file access in order to use this web-based application."


High quality products result from the accumulation of fixes and polish. They also add new desirable features in response to user feedback.

Whether AI is used to write code is irrelevant to a product getting “better”. AI copilots can be used to bootstrap early stage concepts which might be unpolished, or can be used to add polish by writing bug fixes.

I neither subscribe to the mania around AI, nor do I think it will enshittify products. I believe it is just another tool that we can use.


In the USA, folks spend their whole lives jumping from one car subscription or house subscription to the next. In return for something that needs constant maintenance, instead of improving with new features and DLC. And when you stop paying, you lose your life’s work :) /s


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: