Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,16 @@ To remove the requirement of Docker we will change the db provider to `sqlite`.
1. [Sign up](https://salable.app/login) for Salable or [login](https://salable.app/login) if you already have an account.
2. Ensure you have `Test Mode` enabled.

#### Create Product

1. Go to the Products page and click the `Create Product` button.
2. Give your product any name.
3. Tick the `Paid Product` checkbox.
4. Select the test payment integration that is created for you on sign up. If you already have created a payment integration this can be used instead.
5. Select `GBP` as the product's default currency.

#### Create Plan

1. Go to the `Plans` tab and `Create Plan`.
2. Plan name will be `Random String Generator`.
3. Select `Usage` for pricing model.
4. Select `Month` for subscription cycle.
5. Select `Paid` to make it a paid plan.
6. Currencies will then appear, input 1 (£1) as per-unit cost. This will be what the customer will be charged per unit of consumption per billing cycle. The charge per billing cycle will be variable based on what the customer consumes.
7. Click `Next` to proceed to Features.
8. This is section is for creating features and assigning values to plans.
9. Click Create feature and create feature of type Boolean for 16, 32, 64 and 128. These will be used to lock features behind the entitlements check in the demo app.
10. Create the plan.
#### Setup Product

1. Go to the Products page in the Salable dashboard and click the `Import product` button.
2. Navigate to this demo project in the file system on your machine. Select `salable-product.yaml` in the root of the project and import it.
3. As this is a paid product, you'll need to select a payment integration.
4. Click `Import file`.

### Update Environment Variables

1. Copy the Product ID from the "Overview" tab and assign to `NEXT_PUBLIC_PRODUCT_UUID` in the `.env` file.
1. Copy the Product ID from the `Overview` tab and assign to `NEXT_PUBLIC_PRODUCT_UUID` in the `.env` file.
2. Go to `Plans`. Assign the `Random String Generator` plan ID to `NEXT_PUBLIC_SALABLE_PLAN_UUID`.
3. Go to `API Keys`.
4. Copy the API Key that was generated on sign up and assign to `SALABLE_API_KEY`.
Expand Down
68 changes: 68 additions & 0 deletions salable-product.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
version: s1-1.0.0
product:
displayName: Usage demo product
description: ''
paid: true
features:
- displayName: '16'
variableName: '16'
description: ''
visibility: private
valueType: boolean
defaultValue: 'true'
showUnlimited: false
sortOrder: 0
- displayName: '32'
variableName: '32'
description: ''
visibility: public
valueType: boolean
defaultValue: 'true'
showUnlimited: false
sortOrder: 1
- displayName: '64'
variableName: '64'
description: ''
visibility: private
valueType: boolean
defaultValue: 'true'
showUnlimited: false
sortOrder: 2
- displayName: '128'
variableName: '128'
description: ''
visibility: private
valueType: boolean
defaultValue: 'true'
showUnlimited: false
sortOrder: 3
currencies:
- shortName: USD
defaultCurrency: true
plans:
- displayName: Random String Generator
description: ''
visibility: public
pricingType: paid
licenseType: metered
evalDays: 0
interval: month
length: 1
perSeatAmount: 1
maxSeatAmount: -1
features:
- variableName: '16'
value: 'true'
isUnlimited: false
- variableName: '32'
value: 'true'
isUnlimited: false
- variableName: '64'
value: 'true'
isUnlimited: false
- variableName: '128'
value: 'true'
isUnlimited: false
currencies:
- shortName: USD
price: 100