open-index/open-npm huggingface dataset:
npm package: @streamdal/apollo-server-plugin
Description: Streamdal's Apollo Server Plugin for code-native data pipelines
Author: Jacob Heric
Latest version: 0.0.5

# Streamdal code-native data pipeline plugin for Apollo Server  

##### Getting started

```
npm install @streamdal/apollo-server-plugin
```

You must have the Streamdal platform running. To bring it up locally, you can use docker compose:

`docker compose up`

Alternatively you can deploy it to your environment, see here for details: 
```
https://github.com/streamdal/streamdal/tree/main/docs/install
```

Add configuration. You can set configurations via env variables or code. The configuration
variables you provide will point to the Streamdal platform you ran just above.  

If your app supports `.env` files:

```
cp example.env .env
```

Or export them:

```
export STREAMDAL_URL="localhost:8082"
export STREAMDAL_TOKEN="1234"
export STREAMDAL_SERVICE_NAME="user-onboard-service"
```

Or via code: see and uncomment configuration code in the example app:

```
https://github.com/streamdal/streamdal-examples/blob/main/apollo-server-plugin/src/index.ts
```



##### Run the Example App

Clone the examples repository:

```shell
git clone git@github.com:streamdal/streamdal-examples.git
```

```shell
cd streamdal/examples/apollo-server-plugin

npm install

npm start
```

This will fire up an example app running the Streamdal Apollo Server plugin. Go to `http://localhost:4000` 
and execute some graphql queries in the playground. 

After you've run at least one query, go to `http://localhost:8080` and you will see the above operations
were automatically instrumented and you are now able to create and add pipelines 
to them.

![Console](./console-screenshot.png)
npm package: @streamdal/node-sdk
Description: Streamdal's Node SDK
Latest version: 0.2.29

Streamdal Node SDK
==================
[![Release](https://github.com/streamdal/streamdal/actions/workflows/sdks-node-release.yml/badge.svg)](https://github.com/streamdal/streamdal/actions/workflows/sdks-node-release.yml)
[![Pull Request](https://github.com/streamdal/streamdal/actions/workflows/sdks-node-pr.yml/badge.svg)](https://github.com/streamdal/streamdal/blob/main/.github/workflows/sdks-node-pr.yml)
[![Discord](https://img.shields.io/badge/Community-Discord-4c57e8.svg)](https://discord.gg/streamdal)

_**Node SDK for [Streamdal](https://streamdal.com).**_

<sub>For more details, see the main
[streamdal repo](https://github.com/streamdal/streamdal).</sub>

---

## Getting started

Optionally copy `example.env` -> `.env` and specify any custom env vars. 

To use the sdk in your node app:

`npm install @streamdal/node-sdk`

Then construct an instance of `Streamdal` from `"@streamdal/node-sdk"` and use that
to process your data:

```typescript

const config: StreamdalConfigs = {
  streamdalUrl: "localhost:8082",
  streamdalToken: "1234",
  serviceName: "test-service-name",
  pipelineTimeout: "100",
  stepTimeout: "10",
  dryRun: "false",
};

const audience: Audience = {
  serviceName: "test-service-name",
  componentName: "kafka",
  operationType: OperationType.CONSUMER,
  operationName: "test-kafka-consumer",
};

export const example = async () => {
  const streamdal = await registerStreamdal(config);
  const result = await streamdal.process({
    audience,
    data: new TextEncoder().encode(JSON.stringify(exampleData)),
  });

  console.log("streamdal response");
  console.dir(result, {depth: 20});
};

```
*See [./examples](./examples) for runnable examples that can be used as a starters.*

## Documentation

See https://docs.streamdal.com

## Wasm
In order to run pipelines with a minimal amount of overhead, the Streamdal node sdk ships 
and executes pipeline rules as WASM. If you are using Node version < 20.* you'll need to enable 
WASM functionality in your node app by supplying the flag, see:

```
node --experimental-wasi-unstable-preview1 ./build/sandbox/index.js
```

More info: [Node WASM Modules](https://nodejs.org/api/all.html#all_esm_wasm-modules)

## Development  

To do development on the `node-sdk`, you can run it locally:

`npm install`
`npm run sandbox`

See `./src/sandbox/index.ts` for an entry point for local dev.

Optionally install and run the Streamdal [server](https://github.com/streamdal/streamdal/tree/main/apps/server)

## Release

Any push or merge to the `main` branch with any changes in `/sdks/node/*`
will automatically tag and release a new console version with `sdks/node/vX.Y.Z`.

<sub>(1) If you'd like to skip running the release action on push/merge to `main`,
include `norelease` anywhere in the commit message.</sub>

<sub>(2) The `package.json` file will will also be bumped as part of the release
to reflect the new version.</sub>
npm package: @streamdal/plumber-schemas
Description: Plumber Schemas
Author: Streamdal
Latest version: 1.0.1

## Node Protobuf and Typescript types

See `/build/ts`. Protobuf descriptor set is at `/build/ts/descriptor-set` and Typescript types are
at `/build/ts/types`. Those artifacts are also deployed to npm at `@streamdal/protobuf-schemas`.

For an example of how to use them in your Node app,
see: [Snitch Node Client](https://github.com/streamdal/snitch-node-client)