Set up your Scalekit environment
Before you start building, you’ll need to set up your Scalekit environment and obtain your API credentials.
-
Create a Scalekit Account
Scalekit provides dedicated environments for both development and production use. These environments function as extensions of your application where you can manage your authentication services.
Create a Scalekit Account -
Set up your Environments
After creating your account, you’ll have access to two separate environments:
Environment URLs https://{your-subdomain}.scalekit.dev (Development)https://{your-subdomain}.scalekit.com (Production)Each environment is isolated, so resources created in one cannot be transferred to another. You can customize the environment URLs such as
auth.example.com
by adding a custom domain.You can view your environment URLs by navigating to Scalekit Dashboard > API Config.
-
Obtain your API credentials
Scalekit uses the OAuth 2.0 client credentials flow for secure API authentication. This approach provides better security than simple API keys, as your environment and its resources function as extensions of your application’s authentication service.
From the API Config section, note down these three essential values:
Environment variables SCALEKIT_ENVIRONMENT_URL=<your-environment-url># Example: https://acme.scalekit.dev or https://auth.acme.comSCALEKIT_CLIENT_ID=<app-client-id># Example: skc_1234567890abcdefSCALEKIT_CLIENT_SECRET=<app-client-secret># Example: test_abcdef1234567890 -
Instantiate the SDK
npm install @scalekit-sdk/nodepip install scalekit-sdk-pythongo get -u github.com/scalekit-inc/scalekit-sdk-go/* Gradle users - add the following to your dependencies in build file */implementation "com.scalekit:scalekit-sdk-java:2.0.1"<!-- Maven users - add the following to your `pom.xml` --><dependency><groupId>com.scalekit</groupId><artifactId>scalekit-sdk-java</artifactId><version>2.0.1</version></dependency>import { ScalekitClient } from '@scalekit-sdk/node';// Create the Scalekit clientconst scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET);from scalekit import ScalekitClient# Create the Scalekit clientscalekit = ScalekitClient('<SCALEKIT_ENVIRONMENT_URL>','<SCALEKIT_CLIENT_ID>','<SCALEKIT_CLIENT_SECRET>')import ("github.com/scalekit-inc/scalekit-sdk-go")// Create the Scalekit clientscalekitClient := scalekit.NewScalekitClient(os.Getenv("SCALEKIT_ENVIRONMENT_URL"),os.Getenv("SCALEKIT_CLIENT_ID"),os.Getenv("SCALEKIT_CLIENT_SECRET"))import com.scalekit.ScalekitClient;// Create the Scalekit clientScalekitClient scalekitClient = new ScalekitClient(System.getenv("SCALEKIT_ENVIRONMENT_URL"),System.getenv("SCALEKIT_CLIENT_ID"),System.getenv("SCALEKIT_CLIENT_SECRET"));