---
title: Client Modes
description: Choose how c15t connects to its backend — full hosted integration, offline-only, or bring your own backend.
---
<import src="../../../shared/concepts/client-modes.mdx#overview" />

<import src="../../../shared/concepts/client-modes.mdx#hosted-mode" />

```ts
import { getOrCreateConsentRuntime } from 'c15t';

const { consentStore } = getOrCreateConsentRuntime({
  mode: 'hosted',
  backendURL: 'https://your-instance.c15t.dev',
});
```

<import src="../../../shared/concepts/client-modes.mdx#offline-mode" />

```ts
import { getOrCreateConsentRuntime } from 'c15t';

const { consentStore } = getOrCreateConsentRuntime({
  mode: 'offline',
  overrides: {
    country: 'DE', // Override country to trigger GDPR jurisdiction
  },
});
```

<import src="../../../shared/concepts/client-modes.mdx#custom-mode" />

```ts
import { getOrCreateConsentRuntime } from 'c15t';

const { consentStore } = getOrCreateConsentRuntime({
  mode: 'custom',
  endpointHandlers: {
    async init() {
      const res = await fetch('/my-api/consent/init');
      const data = await res.json();
      return { data, response: res, error: null };
    },
    async setConsent(options) {
      const res = await fetch('/my-api/consent', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(options?.body),
      });
      return { data: await res.json(), response: res, error: null };
    },
  },
});
```

<import src="../../../shared/concepts/client-modes.mdx#decision-guide" />
