Skip to main content
The SST SDK provides runtime access to resources you’ve linked in your infrastructure code. It’s available in multiple languages and provides type-safe access to your linked resources.

What is the SDK?

When you link resources in your sst.config.ts, SST automatically generates the necessary configuration to access them at runtime. The SDK provides a convenient Resource API to access these linked resources with full type safety and IntelliSense support.
sst.config.ts
const bucket = new sst.aws.Bucket("MyBucket");

new sst.aws.Function("MyFunction", {
  link: [bucket],
  handler: "src/lambda.handler"
});
In your function code, you can access the bucket:
src/lambda.ts
import { Resource } from "sst";

console.log(Resource.MyBucket.name);

Multi-Language Support

The SST SDK is available for:

JavaScript/TypeScript

Full-featured SDK with auth helpers and type safety

Python

Access linked resources in Python Lambda functions

Go

Type-safe resource access in Go

Rust

Zero-cost abstractions for resource access

Key Features

Type Safety

The SDK provides full TypeScript type definitions based on your linked resources:
import { Resource } from "sst";

// TypeScript knows exactly what properties are available
const bucketName = Resource.MyBucket.name; // ✓ Type-safe
const invalidProp = Resource.MyBucket.invalid; // ✗ TypeScript error

IntelliSense Support

Your IDE provides autocomplete for all linked resources and their properties:
  • Resource names autocomplete as you type
  • Property names and types are suggested
  • Documentation appears inline

Environment Agnostic

The SDK works in multiple environments:
  • Lambda functions - Automatic configuration
  • Containers - ECS/Fargate support
  • Local development - Works with sst dev
  • Cloudflare Workers - Special helpers for Workers environment

How Linking Works

When you link a resource:
  1. Build time - SST analyzes your link arrays
  2. Deploy time - SST generates environment variables or configuration
  3. Runtime - The SDK reads these values and makes them available through Resource
The actual resource values (like bucket names, API URLs, etc.) are injected at deploy time, so your code doesn’t need to know about staging, production, or other environments.

Installation

Install the SDK for your language:
npm install sst

Next Steps

Resource Access

Learn how to access linked resources in your code

Linking Guide

Understand how resource linking works

Build docs developers (and LLMs) love