> For the complete documentation index, see [llms.txt](https://docs.hypertune.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hypertune.com/guides/use-hypertune-outside-of-react.md).

# Use Hypertune outside of React

If you're using React or a React-based framework like Next.js, there may be cases when you need to use Hypertune outside the component tree.

In these cases, the `useHypertune` hook is not available. Instead, use the generated `getHypertuneSingleton` function:

{% code title="lib/logEventOutsideOfReact.ts" %}

```typescript
import { getHypertuneSingleton } from '@/generated/hypertune.react'

export default function logSignUpEventOutsideOfReact() {
  const hypertune = getHypertuneSingleton()

  hypertune.signUp({ args: { properties: {} } })
}
```

{% endcode %}

Prefer the `useHypertune` hook whenever possible. Use `getHypertuneSingleton` only when hooks cannot be used, e.g. in non-React utilities or event handlers outside the component tree.
