> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LaserStream Clients

> High-performance SDKs for gRPC streaming with automatic replay and zero data loss

## Automatic Replay on Disconnect

LaserStream clients continuously track your streaming position by slot number. If a disconnection occurs - from network issues, server maintenance, or any other cause - the client automatically reconnects and resumes streaming from your last processed slot. You never lose data, never miss transactions, and never need to write reconnection logic.

## JavaScript/TypeScript Client

<Warning>
  **We highly recommend switching to LaserStream SDK for JavaScript apps.** If you're currently using Yellowstone gRPC clients, you will experience progressive stream delays and performance bottlenecks that compound over time. LaserStream client's performance headroom ensures your app scales with the network and eliminates these issues entirely.
</Warning>

The [JavaScript client](https://github.com/helius-labs/laserstream-sdk/tree/main/javascript) uses native Rust bindings to achieve 1.3GB/s throughput – over 40x faster than Yellowstone gRPC JavaScript clients that max out at 30MB/s.

**4x faster event detection**: Thanks to its Rust-based architecture, the LaserStream JavaScript client receives and processes events 4x faster than Yellowstone clients, giving your application a significant competitive advantage in seeing events first.

On high-bandwidth subscriptions, Yellowstone clients experience progressive delays that compound over time. LaserStream maintains consistent, low-latency streaming regardless of data volume.

### Installation

<CodeGroup>
  ```bash npm theme={"system"}
  npm install helius-laserstream
  ```

  ```bash yarn theme={"system"}
  yarn add helius-laserstream
  ```

  ```bash pnpm theme={"system"}
  pnpm add helius-laserstream
  ```
</CodeGroup>

<Tip>
  Get started with LaserStream from your [Helius Dashboard](https://dashboard.helius.dev/laserstream). Mainnet requires a Business or Professional plan; Devnet is available on Developer and above. See [Plans & Pricing](/billing/plans) for details.
</Tip>

### Quick Start

```typescript [expandable] theme={"system"}
import { subscribe, CommitmentLevel, LaserstreamConfig, SubscribeRequest } from 'helius-laserstream';

async function streamTransactions() {
  const config: LaserstreamConfig = {
    apiKey: 'YOUR_API_KEY',
    endpoint: 'https://laserstream-mainnet-ewr.helius-rpc.com',
  };

  const request: SubscribeRequest = {
    transactions: {
      "jupiter-filter": { // user-defined label for this filter
        accountInclude: ['JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4'], // Jupiter Program
        accountExclude: [],
        accountRequired: [],
        vote: false,
        failed: false
      }
    },
    commitment: CommitmentLevel.CONFIRMED,
    accounts: {},
    slots: {},
    transactionsStatus: {},
    blocks: {},
    blocksMeta: {},
    entry: {},
    accountsDataSlice: []
  };

  // The SDK handles reconnection and replay automatically
  await subscribe(config, request, 
    async (data) => {
      console.log('New transaction:', data);
    }, 
    async (error) => {
      console.error('Error:', error);
    }
  );
}

streamTransactions().catch(console.error);
```

As of `helius-laserstream` 0.4.0, the JavaScript client supports [compressed account filtering via cuckoo filters](/laserstream/cuckoo-filters) — track hundreds of thousands of accounts in a single subscription instead of sending a large explicit pubkey list.

### Reliability Comparison

| Feature              | LaserStream | Yellowstone                      |
| -------------------- | ----------- | -------------------------------- |
| Automatic Replay     | ✅ Built-in  | ❌ Manual implementation required |
| Progressive Delays   | ❌ None      | ✅ On high bandwidth              |
| Data Loss Protection | ✅ Automatic | ❌ Application responsibility     |
| Reconnection         | ✅ Seamless  | ❌ No built-in support            |

## Rust Client

The [Rust client](https://github.com/helius-labs/laserstream-sdk/tree/main/rust) provides zero-copy deserialization and native performance for applications requiring maximum control.

As of `helius-laserstream` 0.2.0, the Rust client supports [compressed account filtering via cuckoo filters](/laserstream/cuckoo-filters), letting a single subscription track hundreds of thousands of accounts. (Also available in the JavaScript SDK 0.4.0+.)

### Installation

```toml theme={"system"}
[dependencies]
helius-laserstream = "0.2"
tokio = { version = "1", features = ["full"] }
```

### Quick Start

```rust [expandable] theme={"system"}
use futures::StreamExt;
use helius_laserstream::{
    grpc::{CommitmentLevel, SubscribeRequest, SubscribeRequestFilterTransactions},
    subscribe, LaserstreamConfig,
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = LaserstreamConfig {
        api_key: "YOUR_API_KEY".to_string(),
        endpoint: "https://laserstream-mainnet-ewr.helius-rpc.com".to_string(),
        ..Default::default()
    };

    let mut request = SubscribeRequest::default();
    request.transactions.insert(
        "jupiter-filter".to_string(),
        SubscribeRequestFilterTransactions {
            vote: Some(false),
            failed: Some(false),
            account_include: vec!["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4".to_string()],
            ..Default::default()
        },
    );
    request.commitment = Some(CommitmentLevel::Confirmed as i32);

    let (stream, _handle) = subscribe(config, request);
    tokio::pin!(stream);

    while let Some(result) = stream.next().await {
        match result {
            Ok(data) => println!("New transaction: {:?}", data),
            Err(e) => eprintln!("Error: {:?}", e),
        }
    }

    Ok(())
}
```

## Go Client

The [Go client](https://github.com/helius-labs/laserstream-sdk/tree/main/go) provides idiomatic Go interfaces.

### Installation

```bash theme={"system"}
go get github.com/helius-labs/laserstream-sdk/go
```

### Quick Start

```go [expandable] theme={"system"}
package main

import (
    "log"
    "os"
    "os/signal"
    "syscall"

    laserstream "github.com/helius-labs/laserstream-sdk/go"
    pb "github.com/helius-labs/laserstream-sdk/go/proto"
)

func main() {
    clientConfig := laserstream.LaserstreamConfig{
        APIKey:   "YOUR_API_KEY",
        Endpoint: "https://laserstream-mainnet-ewr.helius-rpc.com",
    }

    voteFilter := false
    failedFilter := false
    commitment := pb.CommitmentLevel_CONFIRMED

    subscriptionRequest := &pb.SubscribeRequest{
        Transactions: map[string]*pb.SubscribeRequestFilterTransactions{
            "jupiter-filter": {
                Vote:           &voteFilter,
                Failed:         &failedFilter,
                AccountInclude: []string{"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"},
            },
        },
        Commitment: &commitment,
    }

    client := laserstream.NewClient(clientConfig)

    dataCallback := func(data *pb.SubscribeUpdate) {
        log.Printf("New transaction: %+v\n", data)
    }
    errorCallback := func(err error) {
        log.Printf("Error: %v", err)
    }

    if err := client.Subscribe(subscriptionRequest, dataCallback, errorCallback); err != nil {
        log.Fatalf("Failed to subscribe: %v", err)
    }

    sigChan := make(chan os.Signal, 1)
    signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
    <-sigChan
    client.Close()
}
```

## Why Migrate from Yellowstone to LaserStream

Yellowstone clients face critical limitations that will only worsen as Solana scales:

1. **Performance Bottleneck**: Yellowstone JavaScript clients max out at 30MB/s – insufficient for high-throughput applications
2. **Progressive Delays**: Latency compounds over time on high-bandwidth subscriptions
3. **Manual Replay**: You must implement your own reconnection and replay logic
4. **Data Loss Risk**: Without built-in replay, network disruptions mean missed transactions

**LaserStream solves these problems today**. With 40x better performance, automatic replay, and zero data loss guarantees, migrating to LaserStream ensures your application remains competitive as Solana evolves.
