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

# Quickstart

> Integrate Westyx Nexus into your first service in under 5 minutes.

## Prerequisites

* A Nexus account - we are currently in closed beta. Request access at [nexus.westyx.dev](https://nexus.westyx.dev)
* A project and at least one service created in the console
* An API key for that service (`wxs_...` for backend services, `wxp_...` for frontend)

<Info>
  Backend services use secret keys (backend services only) and can access secrets, configs, and flags.
  Frontend services use public keys (browser/frontend, safe to expose) and can access configs and flags only - secrets are never sent to the browser.
</Info>

<Note>The examples below use Node.js, Python, and React. Full reference for all 8 SDKs is in the [SDK docs](/sdks/overview).</Note>

## 0. Verify connectivity (optional)

Before installing an SDK, confirm your endpoint and API key work with a plain `curl`:

```sh theme={null}
curl -s \
  -H "X-Nexus-API-Key: wxs_..." \
  https://your-service.westyx.dev/v1/sync
```

A valid response returns a JSON snapshot of your configs, secrets, and flags. An `HTTP 401` means the key is wrong; an `HTTP 404` means the slug in the URL is wrong.

You can also tail the live SSE stream:

```sh theme={null}
curl -N \
  -H "X-Nexus-API-Key: wxs_..." \
  -H "Accept: text/event-stream" \
  https://your-service.westyx.dev/v1/stream
```

You should see `event:resync` arrive within a second. Press `Ctrl+C` to stop.

<Note>The `Host` header is set automatically by curl to match the URL - no override needed.</Note>

## 1. Install the SDK

<CodeGroup>
  ```sh Node.js theme={null}
  npm install @westyx-nexus/sdk-nodejs
  ```

  ```sh Python theme={null}
  pip install westyx-nexus-sdk
  ```

  ```sh React theme={null}
  npm install @westyx-nexus/sdk-react
  ```
</CodeGroup>

## 2. Initialize the client

Your service endpoint is shown in the Nexus console on the service detail page.

<CodeGroup>
  ```typescript Node.js theme={null}
  import { NexusClient } from '@westyx-nexus/sdk-nodejs';

  const client = await NexusClient.create({
    endpoint: 'https://your-service.nexus.westyx.dev',
    apiKey:   'wxs_...',
  });
  ```

  ```python Python theme={null}
  from westyx_nexus import NexusClient, NexusConfig

  client = NexusClient.create(NexusConfig(
      base_url='https://your-service.nexus.westyx.dev',
      api_key='wxs_...',
  ))
  ```

  ```tsx React theme={null}
  import { NexusProvider } from '@westyx-nexus/sdk-react';

  export function App() {
    return (
      <NexusProvider config={{
        baseUrl: 'https://your-service.nexus.westyx.dev',
        apiKey:  'wxp_...',
      }}>
        <YourApp />
      </NexusProvider>
    );
  }
  ```
</CodeGroup>

## 3. Read values

<CodeGroup>
  ```typescript Node.js theme={null}
  const dbURL     = client.getConfig('database.url');
  const stripeKey = client.getSecret('stripe.key');
  const newUI     = client.getFlag('new-ui', false);
  ```

  ```python Python theme={null}
  db_url     = client.get_config('database.url')
  stripe_key = client.get_secret('stripe.key')
  new_ui     = client.get_flag('new-ui', False)
  ```

  ```tsx React theme={null}
  import { useConfig, useFlag } from '@westyx-nexus/sdk-react';

  function MyComponent() {
    const apiBase = useConfig<string>('api.base_url');
    const newUI   = useFlag('new-ui', false);
    // ...
  }
  ```
</CodeGroup>

## 4. Enable live updates (recommended)

Value changes pushed from the console propagate to connected SDK clients within milliseconds.

<CodeGroup>
  ```typescript Node.js theme={null}
  // Already started by NexusClient.create().
  // To reconnect manually: client.connectStream()
  ```

  ```python Python theme={null}
  # Already started by NexusClient.create() in a background daemon thread.
  # To reconnect manually: client.connect_stream()
  ```

  ```tsx React theme={null}
  // NexusProvider connects automatically.
  // useFlag() and useConfig() re-render when values change.
  ```
</CodeGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Secrets" icon="lock" href="/features/secrets">
    Learn about secret versioning, file-type secrets, and audit trail.
  </Card>

  <Card title="Feature Flags" icon="toggle-on" href="/features/feature-flags">
    Set up A/B rollout and targeting rules.
  </Card>

  <Card title="Workload Identity" icon="shield" href="/sdks/go#workload-identity-federation">
    Eliminate static API keys with WIF on Kubernetes, AWS, GCP, or Azure.
  </Card>

  <Card title="SDK reference" icon="code" href="/sdks/overview">
    Full reference for all 8 SDKs.
  </Card>
</CardGroup>
