Quickstart
Start using Schematic in under 5 minutes
Create environments and keys
Setting up dev and prod environments
Manage and create new environments using the environment dropdown in the top right corner of Schematic. You can create API keys for each environment indpedently in Settings.
Create an API key
Navigate to the API Keys section of your Settings page to generate your API keys. Once you create a key, an ID and a Secret will be generated. Make sure to store your Secret key in a secure place — Schematic will not display it again after it has been generated.
Secret Keys are used only for server-side integrations. These keys are meant to be confidential, so they should not be used on clients.
Publishable Keys are used in applications and websites to submit identify and track calls, as well as perform client-side feature evaluations. They can be embedded in your application and website.
All keys are environment scoped.
Checking the Audit Log
You can view the Audit log here.
Within each request, you can view detail describing the response code, request ID, start/end times, the API key used, the method, the URL path, and the request & response payloads.
Import your customers
Let’s set up companies within the Schematic Dashboard. We’ll do this by setting up the Stripe integration and importing customers.
- In the Schematic Dashboard, go to Settings > Stripe integration
- Grab your publishable and secret API keys from Stripe by going to Developers > API Keys (link here).
- Go back to the Schematic Dashboard and put in your Stripe API keys to authenticate.
- Schematic will ask you to choose a unique key to map Stripe Customers to Schematic Companies. Ideally this key is also used in your application so that when you make requests to Schematic’s API there is a common key to reference. There are two options:
- If you store a unique identifier in Stripe Customer metadata that you also use in your application (e.g. a
company_id
that is a GUID from your application), choose the first option - If the unique ID that Stripe generates for you (e.g.
cus_nffrfeufn2hib
) is persisted in your application, choose the second option
- If you store a unique identifier in Stripe Customer metadata that you also use in your application (e.g. a
We’ll opt for the second option in this guide (using the Stripe customer ID). Once connected, Schematic should sync companies, subscriptions, and products from Stripe and you should see them appear in the Schematic Dashboard.
Set up Plans
Plans should correspond to your offerings. Eventually, we’ll add feature-level entitlements to them, but we’ll start with just creating Plans in the Schematic Dashboard and linking them to Stripe to inherit active subscriptions.
- Navigate to Catalog and click “Create”
- Add name and a description
- In the Billing step, link the Schematic Plan to a Stripe Product
- Select the Stripe Product that reflects the Schematic Plan. Companies that have active Stripe subscriptions with the mapped product will automatically become a member of the Schematic Plan.
- Once the Plan is created, click the Audience tab and verify the Audience rule and corresponding Companies that have been associated to the Plan.
Repeat the above for a few of your offerings.
Set up Features and Entitlements
Let’s add one feature to Schematic and entitle it to your plans: Search Queries.
- Navigate to Features and click “Create”.
- In the modal, add a name, description, and pick the event-based feature type. Click “Continue”.
- Define a flag key.
- You’ll use this
key
in your application to reference this feature.
- You’ll use this
- Attach an event to the feature. Add the
query
event to meter the feature and measure feature usage (if it doesn’t exist already, create it).
- Once the feature is created, click ”Add plan entitlement” to add an entitlement and specify the limit for Search Query for a given plan.
Build your Customer Portal
Finally, we’ll set up a customer portal that you can drop into your application to quickly add plan management for your users. Actions taken in your customer portal will automatically be synced to Stripe and vice-versa (e.g. checkout, upgrades, downgrades, cancellations, etc.).
After configuring your Catalog, do the following:
- Navigate to Components and click New Component
- Choose “Customer Portal” and click “Create Component”
- You should see a rendered customer portal in the Schematic Component Builder
Integrate Schematic into your application
Now that your pricing and packaging is set up in the Schematic Dashboard, you can integrate it into your codebase. To integrate Schematic into your application, use one of our SDKs: