Skip to content

Commit

Permalink
improve payment docs
Browse files Browse the repository at this point in the history
  • Loading branch information
d-ivashchuk committed Apr 10, 2024
1 parent eedbbc6 commit 67c7343
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/essentials/payments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ const {

For example, if you want to block button clicks(a basic example exists [here](https://cascade.stackonfire.com/app/usage)), you need to add a `buttonClicks` field to your `Plan` schema & reflect it in your `FeatureUsage` schema.

<Tip>
When you create plans automatically with `syncPlansFromLemonsqueezyVariants`
using [this guide](/essentials/payments#setup-on-cascade-side) you need to
manually input the limits for the features in your Database.
</Tip>

```
model Plan {
id Int @id @default(autoincrement())
Expand All @@ -145,6 +151,8 @@ model Plan {
}
```

To properly track feature usage you need to use a `FeatureUsage` model in database. This model will be used to track the usage of each feature for each user. Extent it when needed.

```
model FeatureUsage {
id String @id @default(cuid())
Expand Down

0 comments on commit 67c7343

Please sign in to comment.