Shopify

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

ConnectionWhat a fan getsStatus
Purchase rewardsPoints, XP or an item for buying in your storeLive
Sign in with ShopifyOne account for the store and the communityLive
Store purchases fulfilled by ShopifyPoints spent in the app become a real orderLive
Storefront blocksQuests, their profile and their avatar on your Shopify store itselfIn 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:

JobWho does itWhere
Connecting the storeA community adminThe Hub
Writing reward rulesA community adminThe Hub
Paying a reward when an order arrivesFanBaseAutomatically
Setting up Shopify sign-inFanBase, with your adminPer store
Showing the fan their balanceYouYour 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 withFan gets
Your Shopify storeMoneyProducts, and points when a reward rule matches
The FanBase storePointsA 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

PageCovers
Purchase rewardsWhat your app shows, the rule types, and why a purchase might not pay
Sign in with ShopifyHow store accounts and FanBase accounts are matched
Storefront blocksInstalling the blocks, then one page per block

On this page