---
title: "SolidStart"
description: "Use Integrate with SolidStart"
---
## Installation

Install the Integrate SDK in your SolidStart project:

```bash
bun add integrate-sdk
```

## Setup

### 1. Server Configuration

Create a server configuration file with your OAuth credentials:

```typescript
// lib/integrate.ts
import { createMCPServer, githubIntegration } from "integrate-sdk/server";

export const { client: serverClient } = createMCPServer({
  apiKey: process.env.INTEGRATE_API_KEY,
  integrations: [
    githubIntegration({
      scopes: ["repo", "user"],
    }),
  ],
});
```

SolidStart supports automatically importing the environment variables from the .env file.

You can get an API key from the [Integrate Dashboard](https://integrate.dev/dashboard/login).

### 2. Mount the Handler

Create a catch-all API route at `routes/api/integrate/[...all].ts`:

```typescript
import { toSolidStartHandler } from "integrate-sdk/server";
import { serverClient } from "~/lib/integrate";

const handlers = toSolidStartHandler(serverClient);

export const { GET, POST, PATCH, PUT, DELETE } = handlers;
```

## Configuration

Add your OAuth credentials to your `.env` file:

```bash
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
```

## Usage Examples

### Client-Side Authorization

The client is automatically configured when making requests to the server.

```typescript
import { client } from "integrate-sdk";

await client.authorize("github");
```
