Quick Start
Get a feature flag running in under 5 minutes.
1. Create an Account
Sign up at app.toggletown.com. You'll get a project with two default environments: Production and Development.
2. Create a Flag
- Open your project in the dashboard
- Click Create Flag
- Set the key to
new-checkoutand type to Boolean - Toggle it on in the Development environment
3. Get Your API Key
Go to Project Settings > Environments and copy the API key for your Development environment. It looks like tt_live_....
4. Install an SDK
- JavaScript
- Node.js
- React
- Python
- Go
npm install @toggletown/sdk-js
import { ToggleTownClient } from '@toggletown/sdk-js';
const client = new ToggleTownClient('tt_live_your_key', {
apiUrl: 'https://api.toggletown.com',
});
await client.initialize();
const enabled = client.getBooleanFlag('new-checkout', false, {
userId: 'user-123',
});
if (enabled) {
showNewCheckout();
}
npm install @toggletown/sdk-node
import { ToggleTownClient } from '@toggletown/sdk-node';
const client = new ToggleTownClient('tt_live_your_key');
await client.initialize();
app.get('/checkout', (req, res) => {
const enabled = client.getBooleanFlag('new-checkout', false, {
userId: req.user.id,
});
if (enabled) {
return res.render('new-checkout');
}
res.render('checkout');
});
npm install @toggletown/sdk-react
import { ToggleTownProvider, useBooleanFlag } from '@toggletown/sdk-react';
function App() {
return (
<ToggleTownProvider
apiKey="tt_live_your_key"
context={{ userId: 'user-123' }}
>
<Checkout />
</ToggleTownProvider>
);
}
function Checkout() {
const { value: newCheckout, isLoading } = useBooleanFlag('new-checkout', false);
if (isLoading) return <div>Loading...</div>;
return newCheckout ? <NewCheckout /> : <OldCheckout />;
}
pip install toggletown
from toggletown import ToggleTownClient
client = ToggleTownClient("tt_live_your_key")
client.initialize()
enabled = client.get_boolean_flag("new-checkout", False, {
"user_id": "user-123",
})
if enabled:
show_new_checkout()
client.close()
go get github.com/toggletown/sdk-go
import toggletown "github.com/toggletown/sdk-go"
client := toggletown.NewClient("tt_live_your_key", nil)
if err := client.Initialize(); err != nil {
log.Fatal(err)
}
defer client.Close()
enabled := client.GetBooleanFlag("new-checkout", false, map[string]interface{}{
"user_id": "user-123",
})
if enabled {
showNewCheckout()
}
5. Toggle It
Go back to the dashboard and toggle new-checkout on or off. The SDK will pick up the change on its next poll (within 30 seconds by default).
What's Next?
- Core Concepts — Learn about environments, targeting rules, and rollouts
- SDK docs — Full reference for your SDK
- REST API — Manage flags programmatically