> For the complete documentation index, see [llms.txt](https://docs.winga.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.winga.me/integrations/nodejs.md).

# Node.js / Express

Node.js can use the [`@winga/js`](/sdks/javascript.md) SDK directly. Await `ready()` once at boot so the first request already has flags loaded.

```typescript
import { Winga } from '@winga/js'

const ff = Winga({
  apiKey: process.env.WINGA_KEY!,
  environment: process.env.NODE_ENV === 'production' ? 'production' : 'development',
})

// Wait for the initial snapshot before handling requests.
await ff.ready()

app.get('/checkout', (req, res) => {
  if (ff.isEnabled('new-checkout')) {
    return res.redirect('/checkout-v2')
  }
  return res.render('checkout')
})
```

The client keeps itself current over SSE, so subsequent reads reflect dashboard changes without a redeploy. See the [`@winga/js` reference](/sdks/javascript.md) for the full API.
