Skip to content

Latest commit

 

History

History
423 lines (306 loc) · 12.7 KB

File metadata and controls

423 lines (306 loc) · 12.7 KB
title Set up environment & SDK
description Create your account, install SDK, set up AI tools, and verify your setup to start building with Scalekit
tags
setup
sdk
installation
environment
getting-started
authentication
tableOfContents true
head
tag content
style
.sl-markdown-content h2 { font-size: var(--sl-text-xl); } .sl-markdown-content h3 { font-size: var(--sl-text-lg); }
sidebar
label
Set up environment & SDK
prev false

import { LinkButton, Aside, Steps, Tabs, TabItem, Badge } from '@astrojs/starlight/components' import { VideoPlayer } from 'starlight-videos/components' import InstallSDK from '@components/templates/_installsdk.mdx'

This guide shows you how to set up Scalekit in your development environment. You'll configure your workspace, get API credentials, install the SDK, verify everything works correctly, and optionally set up AI-powered development tools.

Before you begin, create a Scalekit account if you haven't already. After creating your account, a Scalekit workspace is automatically set up for you with dedicated development and production environments.

Create a Scalekit account



1. ## Get your API credentials

Scalekit uses the OAuth 2.0 client credentials flow for secure API authentication.

Navigate to Dashboard > Developers > Settings > API credentials and copy these values:

SCALEKIT_ENVIRONMENT_URL=<your-environment-url> # Example: https://acme.scalekit.dev or https://auth.acme.com (if custom domain is set)
SCALEKIT_CLIENT_ID=<app-client-id> # Example: skc_1234567890abcdef
SCALEKIT_CLIENT_SECRET=<app-client-secret> # Example: test_abcdef1234567890

Your workspace includes two environment URLs:

https://{your-subdomain}.scalekit.dev  (Development)
https://{your-subdomain}.scalekit.com  (Production)

View your environment URLs in Dashboard > Developers > Settings.

  1. Install and initialize the SDK

    Choose your preferred language and install the Scalekit SDK:

    After installation, initialize the SDK with your credentials:

    import { Scalekit } from '@scalekit-sdk/node';
    
    // Initialize the Scalekit client with your credentials
    const scalekit = new Scalekit(
      process.env.SCALEKIT_ENVIRONMENT_URL,
      process.env.SCALEKIT_CLIENT_ID,
      process.env.SCALEKIT_CLIENT_SECRET
    );
    from scalekit import ScalekitClient
    import os
    
    # Initialize the Scalekit client with your credentials
    scalekit_client = ScalekitClient(
      env_url=os.getenv('SCALEKIT_ENVIRONMENT_URL'),
      client_id=os.getenv('SCALEKIT_CLIENT_ID'),
      client_secret=os.getenv('SCALEKIT_CLIENT_SECRET')
    )
    import (
      "os"
      "github.com/scalekit-inc/scalekit-sdk-go"
    )
    
    // Initialize the Scalekit client with your credentials
    scalekitClient := scalekit.NewScalekitClient(
      os.Getenv("SCALEKIT_ENVIRONMENT_URL"),
      os.Getenv("SCALEKIT_CLIENT_ID"),
      os.Getenv("SCALEKIT_CLIENT_SECRET"),
    )
    import com.scalekit.ScalekitClient;
    
    // Initialize the Scalekit client with your credentials
    ScalekitClient scalekitClient = new ScalekitClient(
      System.getenv("SCALEKIT_ENVIRONMENT_URL"),
      System.getenv("SCALEKIT_CLIENT_ID"),
      System.getenv("SCALEKIT_CLIENT_SECRET")
    );
    All official SDKs include automatic retries, error handling, typed models, and auth helper methods to simplify your integration.
  2. Verify your setup

    Test your configuration by listing organizations in your workspace. This confirms your credentials work correctly.

    # Get an access token
    curl https://<SCALEKIT_ENVIRONMENT_URL>/oauth/token \
      -X POST \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -d 'client_id=<SCALEKIT_CLIENT_ID>' \
      -d 'client_secret=<SCALEKIT_CLIENT_SECRET>' \
      -d 'grant_type=client_credentials'

    This returns an access token:

    {
      "access_token": "eyJhbGciOiJSUzI1NiIsImInR5cCI6IkpXVCJ9...",
      "token_type": "Bearer",
      "expires_in": 86399,
      "scope": "openid"
    }

    Use the token to access the Scalekit API

    curl -L '<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations?page_size=5' \
      -H 'Authorization: Bearer <ACCESS_TOKEN>'

    Create a file verify.js with the following code:

    import { ScalekitClient } from '@scalekit-sdk/node';
    
    const scalekit = new ScalekitClient(
      process.env.SCALEKIT_ENVIRONMENT_URL,
      process.env.SCALEKIT_CLIENT_ID,
      process.env.SCALEKIT_CLIENT_SECRET,
    );
    
    const { organizations } = await scalekit.organization.listOrganization({
      pageSize: 5,
    });
    
    console.log(`Name of the first organization: ${organizations[0].display_name}`);

    Run the verification script:

    node verify.js

    Create a file verify.py with the following code:

    from scalekit import ScalekitClient
    import os
    
    # Initialize the SDK client
    scalekit_client = ScalekitClient(
      os.getenv('SCALEKIT_ENVIRONMENT_URL'),
      os.getenv('SCALEKIT_CLIENT_ID'),
      os.getenv('SCALEKIT_CLIENT_SECRET')
    )
    
    org_list = scalekit_client.organization.list_organizations(page_size=5)
    
    print(f'Name of the first organization: {org_list[0].display_name}')

    Run the verification script:

    python verify.py

    Create a file verify.go with the following code:

    package main
    
    import (
      "context"
      "fmt"
      "os"
      "github.com/scalekit-inc/scalekit-sdk-go"
    )
    
    func main() {
      ctx := context.Background()
    
      scalekitClient := scalekit.NewScalekitClient(
        os.Getenv("SCALEKIT_ENVIRONMENT_URL"),
        os.Getenv("SCALEKIT_CLIENT_ID"),
        os.Getenv("SCALEKIT_CLIENT_SECRET"),
      )
    
      organizations, err := scalekitClient.Organization.ListOrganizations(ctx, &scalekit.ListOrganizationsParams{
        PageSize: 5,
      })
    
      if err != nil {
        panic(err)
      }
    
      fmt.Printf("Name of the first organization: %s\n", organizations[0].DisplayName)
    }

    Create a file Verify.java with the following code:

    import com.scalekit.ScalekitClient;
    import com.scalekit.models.ListOrganizationsResponse;
    
    public class Verify {
      public static void main(String[] args) {
        ScalekitClient scalekitClient = new ScalekitClient(
          System.getenv("SCALEKIT_ENVIRONMENT_URL"),
          System.getenv("SCALEKIT_CLIENT_ID"),
          System.getenv("SCALEKIT_CLIENT_SECRET")
        );
    
        ListOrganizationsResponse organizations = scalekitClient.organizations().listOrganizations(5, "");
        System.out.println("Name of the first organization: " + organizations.getOrganizations()[0].getDisplayName());
      }
    }

    If you see organization data, your setup is complete! You're now ready to implement authentication in your application.

Set up Scalekit MCP Server

Scalekit's Model Context Protocol (MCP) server connects your AI coding assistants to Scalekit. Manage environments, organizations, users, and authentication through natural language queries in your MCP client.

The MCP server provides AI assistants with tools for environment management, organization and user management, authentication connection setup, role administration, and admin portal access. It uses OAuth 2.1 authentication to securely connect your AI tools to your Scalekit workspace.

If you're building your own MCP server and need to add OAuth-based authorization, check out our guide: [Add auth to your MCP server](/authenticate/mcp/quickstart/).

Configure your MCP client

Use the most common client configs below. For the full list of supported MCP hosts and editor setups, see the Scalekit MCP server guide.

Run this command in your terminal:

claude mcp add --transport http scalekit https://mcp.scalekit.com/

Edit ~/.cursor/mcp.json, or open Cursor Settings → MCP → Add New Global MCP Server and paste the config:

{
  "mcpServers": {
    "scalekit": {
      "url": "https://mcp.scalekit.com/"
    }
  }
}

Run this command in your terminal:

codex mcp add scalekit --url https://mcp.scalekit.com/

Edit opencode.json in your project root:

{
  "mcp": {
    "scalekit": {
      "type": "remote",
      "url": "https://mcp.scalekit.com/"
    }
  }
}

After configuration, your MCP client will initiate an OAuth authorization workflow to securely connect to Scalekit's MCP server.

For Claude Desktop, VS Code, Windsurf, Gemini CLI, Kiro, Warp, Zed, and other hosts, use the full [Scalekit MCP server guide](/dev-kit/ai-assisted-development/scalekit-mcp-server/).

Configure code editors for Scalekit documentation

In-code editor chat features are powered by models that understand your codebase and project context. These models search the web for relevant information to help you. However, they may not always have the latest information. Follow the instructions below to configure your code editors to explicitly index for up-to-date information.

Set up Cursor

To enable Cursor to access up-to-date Scalekit documentation:

  1. Open Cursor settings (Cmd/Ctrl + ,)
  2. Navigate to Indexing & Docs section
  3. Click on Add
  4. Add https://docs.scalekit.com/llms-full.txt to the indexable URLs
  5. Click on Save

Once configured, use @Scalekit Docs in your chat to ask questions about Scalekit features, APIs, and integration guides. Cursor will search the latest documentation to provide accurate, up-to-date answers.

Use Windsurf

Windsurf enables @docs mentions within the Cascade chat to search for the best answers to your questions.

``` @docs:https://docs.scalekit.com/llms-full.txt ``` Costs more tokens. ``` @docs:https://docs.scalekit.com/your-specific-section-or-file ``` Costs less tokens. ``` @docs:https://docs.scalekit.com/llms.txt ``` Costs tokens as per the model decisions.

Use AI assistants

Assistants like Anthropic Claude, Ollama, Google Gemini, Vercel v0, OpenAI's ChatGPT, or your own models can help you with Scalekit projects.

Don't see instructions for your favorite AI assistant? We'd love to add support for more tools! Raise an issue on our GitHub repository and let us know which AI tool you'd like us to document.