# Native SDKs & no-code plugins

> The same contract as the JavaScript SDK, for iOS, Android and Flutter — plus WordPress and Shopify plugins on their way for teams that would rather not touch code.

Source: https://croombit.com/en/docs/platforms

## Native mobile SDKs

`CroombitSDK` (iOS/macOS/tvOS, Swift + CryptoKit) and the Android SDK (Kotlin, OkHttp, Google Tink) mirror `@croombit/sdk` method for method: `recordConsent`, `getConsentState`, `getPurposes`, the tag-gating `gate()`, and offline **Ed25519** receipt verification performed on-device. A Flutter plugin bridges both over a MethodChannel, so one Dart call reaches whichever native SDK is running underneath.

> **NOTE:** Apps send no `Origin` header, so create the app's `pk_` key with **Allow native apps** enabled — otherwise every call returns 403. For a signed-in user, also pass an **identity token** signed by your backend (`identityToken` option / `setIdentityToken`) — see [Guide: identifying logged-in users](https://croombit.com/en/docs/guides-identity).

```swift
import CroombitSDK

let tc = CroombitClient(CroombitOptions(baseUrl: "https://api.croombit.com", apiKey: "pk_live_…"))
try await tc.recordConsent(
    RecordConsentParams(subject: .email("user@example.com"), purpose: "marketing_email", state: .granted, channel: "app"),
    idempotencyKey: UUID().uuidString
)
```

```kotlin
val tc = CroombitClient(CroombitOptions(baseUrl = "https://api.croombit.com", apiKey = "pk_live_…"))
tc.recordConsent(
    RecordConsentParams(SubjectRef.email("user@example.com"), "marketing_email", ConsentInputState.GRANTED, channel = "app"),
    idempotencyKey = UUID.randomUUID().toString(),
)
```

```dart
final tc = CroombitClient(baseUrl: 'https://api.croombit.com', apiKey: 'pk_live_…');
await tc.recordConsent(
  RecordConsentParams(subject: SubjectRef.email('user@example.com'), purpose: 'marketing_email', state: ConsentInputState.granted, channel: 'app'),
  idempotencyKey: yourOwnUniqueId(),
);
```

> **NOTE:** The mobile SDKs are in **early access** — source-complete and tested, ahead of publishing to the CocoaPods/SPM registry, Maven Central, and pub.dev. Talk to your account contact to get set up. As with the browser SDK, never ship an `sk_` key inside an app binary — `pk_` only.

## No-code plugins (coming soon)

Two plugins that package the same banner are on their way. Until they are published, the banner is one tag: the [setup guides](https://croombit.com/en/integrations) show where it goes on [WordPress](https://croombit.com/en/integrations/wordpress), [Webflow](https://croombit.com/en/integrations/webflow) and [any website](https://croombit.com/en/integrations/html).

- **WordPress** (`croombit-consent`) — a Settings page for your `pk_` key, a `script_loader_tag` filter that attaches the right `data-tc-*` attributes automatically, and two shortcodes: `[croombit_cookie_declaration]` and `[croombit_preferences_link]`.
- **Shopify** — an app embed block (toggle it on in Theme Editor → App embeds, no theme code edits) that also bridges decisions into Shopify’s own `customerPrivacy.setTrackingConsent`, so checkout and analytics honor them too.

> **TIP:** Both plugins will wrap the same `cmp.js` bundle used by the `<script data-tc-api-key>` tag — no separate consent logic to keep in sync, and nothing to migrate if you add the tag by hand today.