What We’ll Cover in This Guide
- Set up Tyk Demo (gateway with prebuilt APIs)
- Install Tyk Sync using Docker
- Use Tyk Sync to dump API configurations from the Tyk Demo
- Observe the dumped configurations
- Make changes and sync back to Tyk Demo
- Verify changes in Tyk Demo
Instructions
1. Set Up Tyk Demo
First, let’s set up a Tyk Demo environment with some prebuilt APIs:http://localhost:3000
.
2. Install Tyk Sync
Follow this guide to install Tyk Sync. You can either use the Docker image or download the binary directly. We will be using the Docker image for this quick start.3. Dump API Configurations
Now, let’s dump the API configurations from the Tyk Dashboard:- Connect to your Tyk Dashboard at
http://localhost:3000
- Use your Dashboard API key for authentication
- Extract all APIs and policies
- Save them to the
tyk-sync-data
directory
4. Observe the Dumped Configurations
Let’s examine what was dumped:- A
.tyk.json
file (index file for synchronization) - A
policies
directory containing policy definitions - An
apis
directory containing API definitions
5. Make Changes and Sync Back
Now, let’s modify an API definition and sync it back to the Dashboard:6. Verify Changes in Tyk Demo
Open your Tyk Dashboard athttp://localhost:3000
and navigate to the APIs section. You should see that your changes have been applied.
Conclusion
Tyk Sync provides a powerful way to manage your API configurations as code. By following this quick start guide, you’ve learned how to:- Extract API configurations from a Tyk Dashboard
- Store them as files that can be version-controlled
- Modify and update configurations
- Synchronize configurations between different environments