# Joy Loyalty Devkit

#### Joy Loyalty Devkit

Joy Loyalty Devkit is made for developers who want to go beyond the default widget and connect directly to Joy’s loyalty engine.

There are two core toolsets:

**1. REST API v2**

Use this to integrate Joy with any external system—mobile apps, backend services, microservices, custom flows, or third-party platforms. With the API, you can:

* Fetch or update loyalty data (points, activities, rewards, tiers, referrals) from your own applications
* Sync Joy events with external systems like CRM, marketing automation, or custom dashboards
* Trigger loyalty logic from outside Shopify — mobile app events, POS extensions, or custom checkout flows
* Build your own admin tools or internal apps powered by Joy’s reward engine

In short: **API = expand Joy outside the storefront.**

**2. JavaScript SDK**

This SDK is designed specifically for storefront developers (Online Store, Headless storefronts, Hydrogen, custom front-end builds). With it, you can:

* Render loyalty components with your own UI instead of Joy’s default widget
* Use Joy’s logic (reward fetching, points calculation, referral link generation) while keeping full control over layout and styling
* Trigger loyalty actions on the storefront using your own UX patterns
* Build inline experiences—embedded tier badges, checkout loyalty hints, custom reward banners, etc.

In short: **JS SDK = build your own loyalty UI on top of Joy.**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devdocs.joy.so/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
