| description | Step-by-step guide to setting up and using the RudderStack Config Generator |
|---|
RudderStack has two components - the Control Plane and the Data Plane. The Data Plane reliably delivers your event data, while the Control Plane manages the configuration of your sources and destinations.
{% hint style="success" %} The easiest way to manage these configurations is through RudderStack's Hosted Control Plane. It is free, requires no setup, and has some advanced features like Live Debugger and a Basic Transformer. {% endhint %}
You can also use the RudderStack Config Generator if you wish to manage the source and destination configurations locally, by exporting to or importing them from a JSON file.
Before setting up the RudderStack Config Generator, make sure you have RudderStack installed locally. You can find the instructions for setting up RudderStack for the platform of your choice in the Install and Set Up RudderStack guide.
{% hint style="warning" %} Please make sure you have Node.js installed before setting up the RudderStack Config Generator. {% endhint %}
In order to set up the RudderStack Config Generator, you will need to run the following commands in the specified order:
cd utils/config-gennpm installnpm start
{% hint style="info" %} The RudderStack Config Generator can be accessed at http://localhost:3000 by default. {% endhint %}
On successful setup, you should be able to see the following UI:
After you add the required sources and destinations in the dashboard as shown above, you can export your workspace configuration by simply clicking the EXPORT button. The configuration is then exported and saved as a JSON file. This workspace configuration is required to start the RudderStack server.
{% hint style="info" %} To know how to add your sources and destinations in RudderStack, please refer to our documentation on Adding a Source and Destination in RudderStack. {% endhint %}
To read the workspace configuration from the exported JSON file, you can update the config variables configFromFile and configJSONPath.
For RudderStack to pick up the exported workspace configuration file, please follow the steps below:
If you are running RudderStack on Docker:
- Open
rudder-docker.yml. - Uncomment
volumessection underbackendservice. Replace<absolute_path_to_workspace_config>with the absolute path of the downloaded workspace configuration file location. - In
environmentsection underbackendservice, uncomment the environment variableRSERVER_BACKEND_CONFIG_CONFIG_FROM_FILE=true.
For a Native RudderStack Installation:
- Open
.envfile. - Add
RSERVER_BACKEND_CONFIG_CONFIG_FROM_FILE=trueto the file - Also add
RSERVER_BACKEND_CONFIG_CONFIG_JSONPATH=<absolute_path_to_workspace_config>. Replace<absolute_path_to_workspace_config>with the absolute path of the downloaded workspace configuration file location.
If you have set up RudderStack on a developer machine:
- Open
config/config.toml. Look forconfigFromFileandconfigJSONPathunder[BackendConfig]. SetconfigFromFileto true andconfigJSONPathto the absolute path of the downloaded workspace configuration file location.
{% hint style="info" %} To know more about the difference between Cloud mode and Device mode in RudderStack, read the RudderStack connection modes guide. {% endhint %}
RudderStack's web, android and iOS SDKs expect the source configurations and the associated device mode destination configurations for initialization.
{% hint style="info" %} By default, RudderStack SDKs fetch the source config (for the write key provided during the initialization of RudderStack SDKs) from https://api.rudderlabs.com/sourceConfig. {% endhint %}
Since SDKs need the source configuration and RudderStack's hosted Control Plane is not aware of it, you must serve the configuration on your web servers and point the SDKs to the same. This configuration must be available at <CONTROL_PLANE_URL>/sourceConfig
Follow these steps:
- Set up the RudderStack Config Generator by following the steps here.
- Go to RudderStack Config Generator UI and export the source config from the source details page by clicking the EXPORT SOURCE CONFIG button, as shown:
- Host the exported file on your own server at
/sourceConfig. Provide the base URL of your server that is serving this file in SDK initialization code snippet:
{% hint style="info" %}
RudderStack SDKs fetch the configuration by appending the /sourceConfig path to the base URL provided above.
{% endhint %}
- The SDKs will fetch the config from
<CONTROL_PLANE_URL>/sourceConfig.
Shown below is a sample of the exported source config:
{
"source": {
"config": {},
"id": "1im8yfXQsocRBGcQLXAaq5M8dYV",
"name": "test-JS",
"writeKey": "1im8yk2sz8oyHVCGVqViSNfKVDF",
"enabled": true,
"sourceDefinitionId": "1TW48i2bIzEl1HPf825cEznfIM8",
"deleted": false,
"createdAt": "Mon Oct 12 2020 16:51:54 GMT+0530 (India Standard Time)",
"updatedAt": "Mon Oct 12 2020 16:51:54 GMT+0530 (India Standard Time)",
"sourceDefinition": {
"id": "1TW48i2bIzEl1HPf825cEznfIM8",
"name": "Javascript",
"displayName": "Javascript",
"category": null,
"createdAt": "2019-11-12T12:39:19.885Z",
"updatedAt": "2020-06-18T11:54:06.114Z"
},
"destinations": [
{
"id": "1im927dBatOkbj1oPCV5JntGMj7",
"name": "test-HJ",
"enabled": true,
"config": {
"siteID": "dd41289"
},
"destinationDefinition": {
"config": {
"destConfig": {
"web": [
"useNativeSDK"
],
"defaultConfig": [
"siteID"
]
},
"secretKeys": [],
"excludeKeys": [],
"includeKeys": [
"siteID"
],
"supportedSourceTypes": [
"web"
]
},
"id": "1SxbQXdfQ2NzIdqNO3GceshF4V0",
"name": "HOTJAR",
"displayName": "Hotjar",
"createdAt": "2019-10-31T07:49:37.450Z",
"updatedAt": "2020-09-05T10:02:39.744Z"
}
}
]
},
"metadata": {
"version": "1.0.2"
}
}
To use the Control Plane URL to initialize your SDKs, follow these steps:
- Set up the RudderStack Config Generator.
- Go to RudderStack Config Generator UI and export the source config from the source details page by clicking the EXPORT SOURCE CONFIG button.
- Host the exported file on your own server such that the config is available at
<CONTROL_PLANE_URL>/sourceConfig.
{% hint style="info" %} This solution assumes that you have already set up RudderStack locally and are hosting your own RudderStack backend (data plane). {% endhint %}
In case you come across any issues while setting up or using the RudderStack Config Generator, please feel free to contact us. You can also start a conversation on our Slack channel. We will be happy to help you!

