Prerequisites
Setting up CodeMash API keys for accessing services
Last updated
Setting up CodeMash API keys for accessing services
Last updated
To make calls to the CodeMash servers and access your resources, you will need - a project ID and a secret key.
Your CodeMash Project ID or Project ID is our primary identifier to differentiate your project from all other CodeMash projects. You will use this in all your SDK initialization codes and API calls. You should not treat the Project ID as private.
Do not share this key!
Treat your REST API Key as though it is a password - do not add it to your app code or public repositories (e.g., GitHub), and do not share it with anyone.
Login to the CodeMash dashboard.
Inside your CodeMash dashboard, select your project.
Inside your project settings, find settings called Project ID and Secret key.
For Project ID, copy it.
For Secret Key, press Regenerate and then copy generated token. The token will not be accessible after you close it; you must regenerate it.
In project settings, you regenerate the Secret Key of your project root account that was created automatically during the initialization process. Never use it in a production environment because this Secret Key has all the permissions, and malicious users can delete your resources and data. For this purpose, create a separate membership user of type "Service" and add only necessary permissions.
The following shows how to store tokens using different languages and frameworks.
To store your tokens in private, use environment variables. This way, you won't expose your secret key to public places.
You can store your tokens in the appsettings.json (name can be different) file in your base project folder. CodeMash SDK expects the following format: