Bixby User Data Persistence Sample Capsule
This is an example Capsule that demonstrates how to save data for each user. It allows user data to persist across conversations by performing CRUD operations on a remote database.
The scenario for this capsule is to allow each user to manage an "army". The user data is the army and consists of a single
Boss Concept and any number of
This will get the user data if it exists, otherwise there will be no results.
nl("Summon my army")
This will update the user data if it exists, otherwise it will create it. We demonstrate 2 types of persistence:
- A property with a single state that gets replaced with any incoming value.
nl("Crown Guru as the big boss")
- A property with multiple values that get appended with any incoming value(s).
nl("Enlist Kavin, Bobby and Stewart")followed by
nl("Conscript Norberto")will result in an army of 4 minions.
This will delete the user data.
nl("Disband my army")
This sample capsule allows you to choose the service you would like to use to
store your user data. Currently, the supported services are
restDB and Airtable. Both of these
offer a generous free tier and are easy to setup. We have test accounts
already up and running that you can use to try them out live. Simply update the
exampleAirtable respectively. Then try some of the capsule queries defined
in the Capsule Usage section above.
Since this capsule is in the
example namespace, it doesn't use dynamic
Secrets. To setup with a real namespace and keep your data secure:
- Select a service and follow the corresponding instructions:
- Register your Team and Capsule in the Bixby Developer Center
- Add configs & secrets in the Bixby Developer Center. Use the field names and values provided in the integration walk-throughs for your selected service. Click the Save button. Now your Configs & Secrets should look like this:
- Edit the
capsule.bxbfile to update the
idkey to match your registered capsule namespace and name
- Edit the
capsule.propertiesfile to change the
capsule.config.modefrom example to
That's it! Now you can sync your capsule and try out some queries!
Note: You may want to repeat the setup instructions twice to have a Dev and a Prod environment.
This is intended for non-sensitive user data.
Your Source for Everything Bixby
- Bixby Developer Center - Everything you need to get started with Bixby Development!
Guides & Best Practices
- Quick Start Guide - Build your first capsule
- Design Guides - Best practices for designing your capsules
- Developer Guides - Guides that take you from design and modeling all the way through deployment of your capsules
- Introduction to Bixby - Bixby and the New Exponential Frontier of Intelligent Assistants
- Bixby Fundamentals - Bixby Fundamentals: What You Need to Know