Setting Up Resources in the Master Account and Using Them in Sub Accounts
In this tutorial, we'll explore how to set up resources in the master account and use them in sub accounts using ChatBotKit. This pattern is particularly useful when creating a software as a service (SaaS) product, as it allows for better reusability and a clear separation boundary between the main product and customer-specific customizations.
Step 1: Set Up the Master Account
- In the master account, create a blueprint and go to the design view.
- Add a bot to the blueprint that will be shared with the sub accounts.
- For this example, we'll keep the solution simple and have the bot perform a web search.
- Set the visibility of the bot to "protected" to make it visible to all sub accounts.
- Do the same for the skillset associated with the bot.
- Build the bot, give it a name (e.g., "SearchBot"), and save it.
Step 2: Test the Bot in the Master Account
- Test the bot in Colabo to ensure it is functioning correctly.
- Verify that the bot can perform the web search as expected.
Step 3: Prepare for Sub Account Integration
- Copy the bot ID from the master account, as it will be needed for the next step.
Step 4: Set Up the Sub Account
- Create a new sub account or switch to an existing one.
- Create a new blueprint in the sub account and go to the design view.
- Add a bot and a skillset to the blueprint.
Step 5: Integrate the Master Account Bot
- In the sub account blueprint, add the "ask bot" ability from the available templates.
- Paste the bot ID copied from the master account into the "bot ID" field of the "ask bot" ability.
- Build the bot and give it a name.
Step 6: Test the Integration
- Test the sub account bot in Colabo.
- Ask the bot to search the web for a specific query.
- Verify that the bot successfully completes the task and returns the expected web results.
Conclusion
In this tutorial, we demonstrated how to set up resources in the master account and use them in sub accounts using ChatBotKit. By setting the visibility of the bot and skillset to "protected" in the master account, we allow them to be accessed and utilized by sub accounts.
This approach enables the creation of flexible solutions where parts of the resources exist at the master account level and sub account level, allowing them to be intermixed to solve specific problems. It provides a foundation for building SaaS products where customers can directly use the main solution defined in the master account within their own sub accounts.
Feel free to expand upon this tutorial and explore more complex scenarios and integrations between master and sub accounts to create powerful and customizable solutions using ChatBotKit.