smallbets / userbase

Create secure and private web apps using only static JavaScript, HTML, and CSS.
https://userbase.com
MIT License
2.28k stars 125 forks source link

Allow some databases to open without payment #229

Open raae opened 3 years ago

raae commented 3 years ago

I would like to capture and save some data from the user before sending them to payment.

It could be a setting in admin that lets us add database names that should not be paywalled.

notrab commented 3 years ago

This sounds like more of an implementation detail than the SDKs? You can create databases currently now without having an active subscription, unless I misunderstood your question?

raae commented 3 years ago

Can I, I thought as soon as you added the payment add on the databases would not open without an active subscription. Should probably take a closer look.

notrab commented 3 years ago

@raae yeah. Neither of them are coupled from what I can tell.

shamblesides commented 3 years ago

@notrab I also understood things the way @raae was describing. From the docs:

Upon successful payment, the user's subscriptionStatus will be set to 'active'. This allows the user to successfully call openDatabase on an app with payments enabled.

I think this means that once the payment add-on is enabled, users can no longer access or modify any Userbase databases without entering into a paid subscription.

notrab commented 3 years ago

Interesting. Thanks for sharing that. I don’t have a live stripe key enabled so maybe this is why I have experienced different results. Be interested to get an official answer on this, and maybe we could PR docs to make it clearer.

j-berman commented 3 years ago

I think this means that once the payment add-on is enabled, users can no longer access or modify any Userbase databases without entering into a paid subscription.

This is correct! Agreed the language could be clearer.

j-berman commented 3 years ago

@raae

I would like to capture and save some data from the user before sending them to payment.

You're able to update a user's profile before payment. Would that work for you?

It could be a setting in admin that lets us add database names that should not be paywalled.

This is challenging because database names are actually end-to-end encrypted as well (i.e. admins can't see database names). We could instead allow X number of databases before payment is required, or allow you to set that value yourself.

raae commented 3 years ago

You're able to update a user's profile before payment. Would that work for you?

No because I need it to be encrypted, it's the tag they will use for menstruation and the average length. But I can adjust and change my the onboarding flow, collecting payment first.

This is challenging because database names are actually end-to-end encrypted as well

I like this!

We could instead allow X number of databases before payment is required, or allow you to set that value yourself.

This is interesting as I can see it opening up for a diverse set of payment models. But not something I must have as of now.

spiffytech commented 3 years ago

I think this means that once the payment add-on is enabled, users can no longer access or modify any Userbase databases without entering into a paid subscription.

This is correct! Agreed the language could be clearer.

Does this mean Userbase doesn't work for a freemium model, where users can make some use of their database for free, and upgrade for more [userland-implemented] features?

I was just about to integrate Userbase into my project, but I'm making a freemium product, and both free and paid users need to be in the same Userbase app because they share content with each other. I'm excited to use Userbase, but it's a dealbreaker if it doesn't support freemium apps.

We could instead allow X number of databases before payment is required, or allow you to set that value yourself.

That isn't a fit for my use case; my users will create lots of databases (dozens/hundreds each?) since databases are the way to partition shared data in Userbase, and sharing collections is one of my product's core value propositions.


I see that user profiles include a trialExpirationDate property. Does a user have to enter credit card data to qualify for a trial? Or could I use a credit-card-less 1000-year trial to implement freemium?

raae commented 3 years ago

The trial would be set up through Stripe I believe, so that would not be credit card less @spiffytech.

j-berman commented 3 years ago

@spiffytech

Does this mean Userbase doesn't work for a freemium model, where users can make some use of their database for free, and upgrade for more [userland-implemented] features?

Freemium model works with our payments feature now! Apologies for the confusion. In #243 we added this toggle in the Admin Panel:

Screen Shot 2020-12-09 at 2 38 14 AM

Does a user have to enter credit card data to qualify for a trial?

Nope (though doesn't sound like you're looking to use a trial).


@raae

Trials are now set up directly in the Admin Panel :)

(See major change 3 in #243)

raae commented 3 years ago

After testing it out I see that I can write to a database, but not open it and that works well with my use case. Feel free to close @j-berman.