Create Reusable Weavy Component Templates
Build reusable component templates for Weavy collaboration features in your Superblocks applications. This guide covers creating custom templates that can be deployed across multiple pages and apps.
Prerequisites
You will need:
- A Weavy API key
- A Superblocks account with admin rights
- An existing Superblocks app
- Git and Node.js installed
Step 1: Select Your Weavy API Key and Environment
Choose your Weavy environment and API key that you'll use for the template.
Step 2: Create WeavyAPI REST Integration
Set up the REST API integration:
- Name: WeavyAPI
- URL: Your Weavy backend URL
- Headers:
Authorization: Bearer YOUR_API_KEYContent-Type: application/json
Step 3: Add Frontend Variable for Weavy URL
Create a WEAVY_URL frontend variable in your app's scope with your Weavy backend URL as the default value.
Step 4: Clone the Superblocks Weavy Components Repository
git clone https://github.com/weavy-labs/superblocks-weavy-components.git
cd superblocks-weavy-components
Step 5: Install Dependencies
npm install
Step 6: Authenticate with Superblocks
npx superblocks login
Step 7: Create Templates
Run the installation script to create your reusable templates:
npm run create:components
This will set up all necessary components and workflows as templates that you can:
- Reuse across multiple pages
- Customize with different properties
- Share with your team
Step 8: Done!
Your component templates are created and ready to use throughout your Superblocks applications. Templates provide a consistent way to add collaboration features while maintaining flexibility for customization.
Tip: Use templates to standardize how your team implements Weavy components across different parts of your application.