---
title: "GenLayerJS SDK"
description: "GenLayerJS SDK covers TypeScript tools for building DApps on GenLayer with clients, transactions, events, and Viem."
source: https://docs.genlayer.com/developers/decentralized-applications/genlayer-js
last_updated: 2026-06-11
---

# GenLayerJS SDK

GenLayerJS SDK is a TypeScript library for building decentralized applications (DApps) on the GenLayer protocol. It provides tools for interacting with the GenLayer network, including client creation, transaction handling, event subscriptions, and more, while using Viem as the underlying blockchain client.

## Features

- **Client Creation**: Easily create and configure a client to connect to GenLayer’s network.
- **Transaction Handling**: Send and manage transactions on the GenLayer network.
- **Contract Interaction**: Read from and write to smart contracts deployed on GenLayer.
- **Event Subscriptions**: Subscribe to events and listen for blockchain updates.
- **TypeScript Support**: Benefit from static typing and improved code reliability.

## How it's Built

The GenLayerJS SDK is built using **TypeScript** and leverages the **Viem** library as the underlying blockchain client. It is designed to provide a high-level, easy-to-use API for interacting with the GenLayer network, abstracting away the complexities of direct blockchain interactions.

### Technologies Used

- **TypeScript**: A statically typed superset of JavaScript that compiles to plain JavaScript, enhancing code reliability and maintainability.
- **Viem**: A modular and extensible blockchain client for JavaScript and TypeScript.
- **ESBuild**: A fast JavaScript bundler and minifier used for building the SDK efficiently.
- **Vitest**: A Vite-native unit test framework used for testing.

### Project Structure

The source code for the GenLayerJS SDK is organized as follows:

- `src/`: Contains the main TypeScript source files.
- `tests/`: Includes all the test files written using Vitest.
- `dist/`: The compiled JavaScript files ready for use.

## Requirements

Before using the GenLayerJS SDK, ensure your system meets the following requirements:

- **Node.js**: Version 16.x or higher is required.
- **npm**: Comes bundled with Node.js, used for managing packages.
- **Operating System**: Compatible with macOS, Linux, and Windows.

### Installation

To install the GenLayerJS SDK, use the following command:

```bash
npm install genlayer-js
```

## Usage

Here’s how to initialize the client and connect to the GenLayer Studio:

- **[Reading a transaction](../intelligent-contracts/features/interacting-with-intelligent-contracts)**: Understand how to query transactions on the GenLayer network.
- **[Reading a contract](/developers/decentralized-applications/reading-data)**: Discover how to read data from intelligent contracts on GenLayer.
- **[Writing a contract](../intelligent-contracts/tools/genlayer-studio/contract-state)**: Learn how to write data to intelligent contracts on GenLayer.

## General Format of Commands

The GenLayerJS SDK provides functions that follow a consistent syntax pattern:

```typescript
client.functionName(parameters);
```

- `client`: The instance of the GenLayer client.
- `functionName`: The primary action you want to perform (e.g., `getTransaction`, `readContract`).
- `parameters`: An object containing the required parameters for the function.

## Further Development

Additional features are planned to enhance interaction with the GenLayer network, including wallet integration and gas estimation. Stay tuned for updates.

## Repository

You can find the GenLayerJS SDK repository on GitHub:

[GenLayerJS SDK Repository](https://github.com/genlayerlabs/genlayer-js)

## Full Reference

The full reference for the GenLayerJS SDK is available in the [GenLayerJS SDK Reference](/references/genlayer-js).
