Skip to main content

Installation

Install GLIN SDK for your preferred language.

Prerequisites

  • Node.js 18 or later
  • npm, yarn, or pnpm package manager

Check your Node.js version:

node --version

Install SDK

Install via your preferred package manager:

npm:

npm install @glin-ai/sdk

yarn:

yarn add @glin-ai/sdk

pnpm:

pnpm add @glin-ai/sdk

For TypeScript Projects

If you're using TypeScript, the SDK includes built-in type definitions. No additional @types packages needed!

tsconfig.json
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "node",
"lib": ["ES2020"],
"types": ["node"]
}
}

Verify Installation

Let's verify the SDK is installed correctly:

Create a test file test.ts:

test.ts
import { GlinClient } from '@glin-ai/sdk';

console.log('✅ GLIN SDK installed successfully!');
console.log('Version:', require('@glin-ai/sdk/package.json').version);

Run it:

npx tsx test.ts
# or
node --loader ts-node/esm test.ts

Optional Dependencies

TypeScript

For browser-based applications:

npm install @polkadot/extension-dapp

For Next.js apps:

npm install @glin-ai/sdk next@15

Rust

For CLI development:

cargo add colored indicatif clap --features clap/derive

For indexer development:

cargo add sqlx --features runtime-tokio-rustls,postgres

What's Next?

Now that you have the SDK installed, let's build your first app:

Quick Start Guide

Troubleshooting

Node.js: Module not found

If you see Cannot find module '@glin-ai/sdk':

  1. Make sure you're in the correct directory
  2. Run npm install again
  3. Delete node_modules and package-lock.json, then reinstall

Rust: Compilation errors

If you see compilation errors:

  1. Update Rust: rustup update
  2. Make sure you're using Rust 1.70+: rustc --version
  3. Clear cache: cargo clean && cargo build

Network Connection Issues

Make sure you can reach the GLIN testnet:

curl -I https://testnet.glin.ai

Still having issues? Ask on Discord