> ## 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.

# Solana Data Streaming Quickstart

> Get your first real-time Solana data stream running in under 5 minutes. LaserStream gRPC, LaserStream WebSocket, and Webhooks setup guide.

## Quick Setup

Get streaming Solana data in minutes with working code examples. Choose your approach based on your needs:

| Method                    | Best For                                       | Plan Required                                            | Latency               |
| ------------------------- | ---------------------------------------------- | -------------------------------------------------------- | --------------------- |
| **Shred Delivery**        | HFT, MEV, arbitrage — pre-execution data       | All plans ([paid add-on](/billing/plans#shred-delivery)) | **Earliest possible** |
| **LaserStream gRPC**      | Mission-critical, backend services             | All plans (Devnet), Business+ (Mainnet)                  | **Fastest**           |
| **LaserStream WebSocket** | Most apps, real-time UIs, broad compatibility. | Free+ (Helius extensions: Developer+)                    | **Fast**              |
| **Webhooks**              | Server notifications, event-driven apps        | Free+                                                    | **Variable**          |

<Tip>
  Need raw shreds? [Subscribe from the Shreds tab](https://dashboard.helius.dev/shred-delivery-seats) in your Helius Dashboard. See [How to Subscribe to Raw Shreds](/shred-delivery/raw-shreds) for setup steps.
</Tip>

## Option 1: LaserStream gRPC

Most reliable option with [24-hour historical replay](/laserstream/historical-replay) and multi-node failover. Best for mission-critical backends and indexers.

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

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

async function main() {
  const subscriptionRequest: SubscribeRequest = {
    transactions: {
      "token-filter": { // user-defined label for this filter
        accountInclude: ['TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'],
        accountExclude: [],
        accountRequired: [],
        vote: false,
        failed: false
      }
    },
    commitment: CommitmentLevel.CONFIRMED,
    accounts: {},
    slots: {},
    transactionsStatus: {},
    blocks: {},
    blocksMeta: {},
    entry: {},
    accountsDataSlice: [],
  };

  const config: LaserstreamConfig = {
    apiKey: 'YOUR_API_KEY',
    endpoint: 'https://laserstream-mainnet-ewr.helius-rpc.com',
  }

  await subscribe(config, subscriptionRequest, async (data) => {
    console.log(data);
  }, async (error) => {
    console.error(error);
  });
}

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

<CardGroup cols={2}>
  <Card title="LaserStream Guide" icon="book" href="/laserstream">
    Complete LaserStream documentation with historical replay
  </Card>

  <Card title="Get Started" icon="rocket" href="https://dashboard.helius.dev/laserstream">
    Enable LaserStream from your Helius Dashboard and start streaming.
  </Card>
</CardGroup>

## Option 2: LaserStream WebSocket

[LaserStream WebSocket](/rpc/websocket) serves the [standard Solana subscription methods](/api-reference/rpc/websocket-methods) and Helius extensions like `transactionSubscribe` on a single unified endpoint. Perfect for browser/UI clients and broad ecosystem compatibility.

```javascript theme={"system"}
const WebSocket = require('ws');

const ws = new WebSocket('wss://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY');

ws.on('open', () => {
  console.log('WebSocket connected');

  // Helius extension: transactionSubscribe with rich filtering
  ws.send(JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "transactionSubscribe",
    params: [
      {
        accountInclude: ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
        vote: false,
        failed: false
      },
      {
        commitment: "confirmed",
        encoding: "jsonParsed",
        transactionDetails: "full"
      }
    ]
  }));

  // Keep connection alive
  setInterval(() => ws.ping(), 30000);
});

ws.on('message', (data) => {
  const message = JSON.parse(data);
  console.log('Transaction:', message);
});
```

**Replace `YOUR_API_KEY`** with your key from [dashboard.helius.dev](https://dashboard.helius.dev).

<Card title="LaserStream WebSocket Overview" icon="arrow-right" href="/rpc/websocket">
  All subscription methods (standard Solana + Helius extensions) with parameter reference and examples
</Card>

## Option 3: Webhooks

For server-side applications that need event notifications without holding a persistent connection.

```bash theme={"system"}
# Create a webhook
curl -X POST "https://mainnet.helius-rpc.com/v0/webhooks" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookURL": "https://your-server.com/webhook",
    "transactionTypes": ["Any"],
    "accountAddresses": ["YOUR_ACCOUNT_ADDRESS"],
    "webhookType": "enhanced"
  }'
```

```javascript theme={"system"}
// Handle webhook events (Express.js example)
app.post('/webhook', (req, res) => {
  req.body.forEach(event => {
    console.log('Blockchain event:', event);
  });
  res.status(200).send('OK');
});
```

<Card title="Webhooks Guide" icon="arrow-right" href="/webhooks">
  Complete webhook setup and event handling
</Card>

## Common Use Cases

**Monitor Token Transfers**

```javascript theme={"system"}
// Subscribe to Token Program activity
method: "programSubscribe",
params: ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", {...}]
```

**Track Pump.fun trades**

```javascript theme={"system"}
// Subscribe to Pump.fun program transactions
method: "transactionSubscribe",
params: [
  {
    accountInclude: ["6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"],
    vote: false,
    failed: false
  },
  { commitment: "confirmed" }
]
```

**Watch Wallet Activity**

```javascript theme={"system"}
// Monitor specific wallet
method: "accountSubscribe",
params: ["WALLET_ADDRESS", {...}]
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Streaming Overview" icon="play" href="/data-streaming">
    Learn about all streaming options and when to use each
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference">
    Complete method documentation and parameters
  </Card>
</CardGroup>

**Need help?** Join our [Discord](https://discord.com/invite/6GXdee3gBj) or check [support docs](/support).
