FanBase on Shopify
Rewards for purchases, sign-in with a store account, and FanBase blocks inside a Shopify theme.
Most FanBase communities sell through Shopify. This section covers every place the two meet, and which of them involve code.
Four connections
| Connection | What a fan gets | Status |
|---|---|---|
| Purchase rewards | Points, XP or an item for buying in your store | Live |
| Sign in with Shopify | One account for the store and the community | Live |
| Store purchases fulfilled by Shopify | Points spent in the app become a real order | Live |
| Storefront blocks | Quests, their profile and their avatar on your Shopify store itself | In build |
They are independent. A community can reward purchases without ever putting a block on its storefront, and the other way round.
Which one you are building
It comes down to where your pages live.
Your site is a React app. Use the SDK, which is everything else in these docs. Shopify stays in the background: purchases pay out on FanBase's side, and your app shows the result. Start with Purchase rewards.
Your site is a Shopify theme. A theme is Liquid, not React, so the SDK's components cannot be imported into it. Storefront blocks are the same features packaged for a theme: you add them in the theme editor, with no code. Start with Setting up.
You have both. A React site for the community and a Shopify store for the shop is common, and both can run at once. They read the same community, so a quest completed on one shows as completed on the other.
The SDK has no Shopify code
Worth saying plainly, because it saves an agent a wasted afternoon. There is no Shopify hook, no Shopify component and no Shopify login provider in the React packages.
Everything Shopify does happens on FanBase's side, set up by a person:
| Job | Who does it | Where |
|---|---|---|
| Connecting the store | A community admin | The Hub |
| Writing reward rules | A community admin | The Hub |
| Paying a reward when an order arrives | FanBase | Automatically |
| Setting up Shopify sign-in | FanBase, with your admin | Per store |
| Showing the fan their balance | You | Your app, with the SDK |
Only the last row is code. Do not build a webhook server, and do not look for an endpoint that awards points. Neither is needed, and the second does not exist.
Connecting a store and writing reward rules is covered step by step in the Shopify page of the Hub docs.
One fan, one account
Everything here depends on FanBase knowing that a customer in your store and a fan in your community are the same person. The link is the email address.
- An order is matched to a fan by the email on the order
- A fan who signs in with their store account gets the FanBase account with that email, or a new one
A fan who shops with one email and plays with another is two people as far as rewards are concerned. That is the most common reason a purchase pays nothing, and Purchase rewards walks through the rest.
Spending is not earning
Two things in FanBase are called a store, and they point in opposite directions.
| Fan pays with | Fan gets | |
|---|---|---|
| Your Shopify store | Money | Products, and points when a reward rule matches |
| The FanBase store | Points | A listing, which can be a real product shipped by Shopify |
Buying in the FanBase store spends points and never earns them. When that purchase creates an order in Shopify, FanBase marks the order so no reward rule fires on it. Without that, a fan could spend points on a product and earn points back for buying it.
The pages
| Page | Covers |
|---|---|
| Purchase rewards | What your app shows, the rule types, and why a purchase might not pay |
| Sign in with Shopify | How store accounts and FanBase accounts are matched |
| Storefront blocks | Installing the blocks, then one page per block |