Skip to main content

SDKs & Storefront Integrations

Package availability, Shopify & WooCommerce store extensions, PKCE mobile clients, and server-side integration code.

Transparent Availability & Security Contract

Web/Node packages and widget bundles marked Available & Tested are compiled and verified in CI. Native iOS/Android/Flutter mobile templates integrate cleanly via PKCE + REST endpoints with secret keys strictly stored on merchant backend servers.

Website Integration • v2.0.0

JavaScript SDK / Storefront Widget

Available & Tested

<script src="https://beunifit.in/v1/widget/unifit.js" data-unifit-key="pk_live_YOUR_PUBLISHABLE_KEY" async></script>

Setup: Mount UniFitWidget.mount({ publishableKey, productId, container }). Uses PKCE popup and public publishableKey only.

Troubleshooting: Ensure your storefront domain is saved in Security & Permissions -> Allowed Domains.

Shopify Stores • v1.4.0

Shopify App & Liquid Block

Available Package

packages/sdks/shopify-app/extensions/unifit-size-block.liquid

Setup: Add the Online Store 2.0 App Block on your PDP section and paste your Storefront Publishable Key.

Troubleshooting: For live Shopify webhooks beyond sandbox, configure SHOPIFY_API_KEY & SHOPIFY_API_SECRET on API backend.

WordPress Stores • v1.3.0

WooCommerce WordPress Plugin

Available Package

packages/sdks/woocommerce-plugin/unifit-sizing.php

Setup: Upload plugin to WordPress, add Publishable Key (storefront) and Server Key (WP Admin settings only).

Troubleshooting: Flush WordPress rewrite rules and confirm HTTPS SSRF rules when testing order webhooks.

Custom Websites & Backends • v2.0.0

REST API Client (@unifit/sdk)

Available & Tested

packages/sdks/typescript-sdk • OpenAPI 3.0 at /api/openapi.json

Setup: Authenticate server-to-server calls with Authorization: Bearer <server_key>.

Troubleshooting: Inspect X-RateLimit-Remaining and X-UniFit-Quota-Used response headers on HTTP 429.

Cross-Platform Mobile Apps • v1.2.0

React Native SDK

Available Package

Use @unifit/sdk TypeScript client with Expo AuthSession PKCE

Setup: Redirect users to /auth/authorize with S256 challenge and proxy recommendation fetches via your backend.

Troubleshooting: Never compile secret uf_live_ keys into JS/React Native bundles.

Flutter Applications • Guide v2.0

Flutter SDK Pattern

REST Integration Guide

Dart http + flutter_web_auth_2 PKCE against /auth/authorize

Setup: Exchange PKCE auth code server-side at POST /v1/consents/token and request POST /v1/recommendations.

Troubleshooting: Register mobile deep-link schemes in Security & Permissions -> Redirect URLs.

iOS Apps • Template v1.1

Native iOS SDK (Swift)

REST Integration Guide

packages/sdks/ios-swift/UniFitSDK.swift (URLSession + ASWebAuthenticationSession)

Setup: Initialize UniFitClient(publishableKey:) and broker recommendation requests via your backend.

Troubleshooting: Add Associated Domains / Universal Links matching your configured callback URI.

Android Apps • Template v1.1

Native Android SDK (Kotlin)

REST Integration Guide

packages/sdks/android-kotlin/UniFitSDK.kt (OkHttp + Custom Tabs PKCE)

Setup: Register Android App Link redirect URI and send PKCE grants through your server API.

Troubleshooting: Verify Intent Filter autoVerify and SHA-256 assetlinks configuration.

Powered by UniFit AI

cURL — Call Powered by UniFit AI Fit Advice

curl -i -X POST "https://beunifit.in/api/v1/ai/fit-advice" \
  -H "Authorization: Bearer YOUR_UNIFIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"garmentTitle":"Structured Poplin Shirt","categorySlug":"shirts","fitType":"REGULAR","fabricStretch":"LOW"}'