open-index/open-npm huggingface dataset:
npm package: @prex0/pass0-sdk
Description: A TypeScript SDK for the Pass0 API, generated from OpenAPI schema using [openapi-typescript](https://github.com/openapi-ts/openapi-typescript).
Latest version: 0.1.0

# @prex0/pass0-sdk

A TypeScript SDK for the Pass0 API, generated from OpenAPI schema using [openapi-typescript](https://github.com/openapi-ts/openapi-typescript).

## Installation

```bash
pnpm add @prex0/pass0-sdk
```

## Usage

### Basic Usage

```typescript
import { createPass0Client } from "@prex0/pass0-sdk";

const client = createPass0Client({
  baseUrl: "https://api.example.com",
});

// Get user subscription by plan ID
const { data, error } = await client.GET(
  "/subscriptions/user/subscriptions/plans/{planId}",
  {
    params: {
      path: { planId: "123" },
    },
  }
);

if (error) {
  console.error("Error:", error);
} else {
  console.log("Subscription:", data);
}
```

### Authenticated Usage

```typescript
import { createAuthenticatedPass0Client } from "@prex0/pass0-sdk";

const client = createAuthenticatedPass0Client(
  {
    baseUrl: "https://api.example.com",
  },
  "your-auth-token"
);

// The client will automatically include the Authorization header
const { data, error } = await client.GET(
  "/subscriptions/user/subscriptions/plans/{planId}",
  {
    params: {
      path: { planId: "123" },
    },
  }
);
```

### With Custom Headers

```typescript
import { createPass0Client } from "@prex0/pass0-sdk";

const client = createPass0Client({
  baseUrl: "https://api.example.com",
  headers: {
    "X-Custom-Header": "value",
  },
});
```

## Development

### Generate Types

```bash
pnpm generate
```

This will regenerate TypeScript types from `schema.yaml` using `openapi-typescript`.

### Build

```bash
pnpm build
```

### Development Mode

```bash
pnpm dev
```

## API Documentation

The SDK is generated from the OpenAPI schema defined in `schema.yaml`. See the schema file for complete API documentation.

### Available Endpoints

- `GET /subscriptions/user/subscriptions/plans/{planId}` - Get user subscription by plan ID

## Type Safety

This SDK provides full TypeScript type safety for:

- Request parameters (path, query, headers, body)
- Response data
- Error responses

All types are automatically generated from the OpenAPI schema.

## License

See the root package for license information.