> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended**:
> ```bash
> npx @scalekit-inc/cli setup
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for 40+ agents.
> Features: full-stack-auth, agent-auth, mcp-auth, modular-sso, modular-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Domains

Manage organization email domains
<div class="sdk-client-page">

Use the `domain` client to manage verified email domains for an organization (SSO routing and domain-based policies).

Add a domain, complete verification, then use it with SSO and organization policies.

### createDomain
<div class="sdk-method-section">
  
    
      

      Adds a new domain configuration to an organization for SSO routing or user suggestions.

      
        The organization ID (format: "org_...")
      
      
        The domain name (e.g., "acme.com", "example.org")
      
      
        Optional fields: `domainType`.
      
      
        The created domain with ID and verification status
      

```typescript wrap showLineNumbers=false
// domainType: Domain type filter
const response = await scalekit.domain.createDomain(
  'org_123456',
  'acme.com',
  { domainType: 'ORGANIZATION_DOMAIN' }
);

console.log('Domain created:', response.domain.id);
```

    
  
</div>

### getDomain
<div class="sdk-method-section">
  
    
      

      Retrieves detailed information about a specific domain configuration.

      
        The organization ID (format: "org_...")
      
      
        The domain ID (format: "domain_...")
      
      
        Complete domain configuration and status
      

```typescript wrap showLineNumbers=false
const response = await scalekit.domain.getDomain(
  'org_123456',
  'domain_abc123'
);

console.log('Domain:', response.domain.domain);
console.log('Type:', response.domain.domainType);
console.log('Verified:', response.domain.verificationStatus);
```

    
  
</div>

### listDomains
<div class="sdk-method-section">
  
    
      

      Retrieves all domain configurations for an organization.

      
        The organization ID (format: "org_...")
      
      
        Optional fields: `domainType`.
      
      
        List of all domains with their configurations
      

```typescript wrap showLineNumbers=false
// domainType: Domain type filter
const response = await scalekit.domain.listDomains('org_123456');

console.log(`Found ${response.domains.length} domains`);
response.domains.forEach(domain => {
  console.log(`- ${domain.domain} (${domain.domainType}): ${domain.verificationStatus}`);
});
```

    
  
</div>

### deleteDomain
<div class="sdk-method-section">
  
    
      

      Deletes a domain from an organization.

      
        The organization ID
      
      
        The domain ID to delete
      
      
        Empty response on successful deletion
      

```typescript wrap showLineNumbers=false
await scalekit.domain.deleteDomain('org_123456', 'domain_abc123');
console.log('Domain deleted successfully');
```

    
  
</div>

</div>


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
