Skip to main content

Boilerplate Overview

Boilerplate is a pre-written codebase that speeds up development by providing a foundational template for building extensions.

The FDK CLI ships a boilerplate for each supported stack. Every one of them does the same thing — authenticates with Fynd Commerce, lists the products of a company, and receives webhooks — so you can pick the stack your team already knows and read the page for it.

Prerequisite

If you do not have a boilerplate yet, go through the steps on the Get Started page.

If FDK CLI is already set up, fdk ext init walks you through an interactive stack picker. Pass --template to skip it and select a stack directly.

Pick your stack

JavaScript

StackTemplateStorageExplanation
Node + React.jsnode-reactSQLiteNode + React
Node + React.js + Fit.jsnode-react-fitMongoDB + RedisNode + React + Fit.js
Node + Vue 3node-vueSQLite
Node + Next.jsnode-nextSQLite

Java

StackTemplateStorageExplanation
Java + React.jsjava-reactSQLiteJava + React
Java + Vue 2java-vueSQLite

Python

StackTemplateStorageExplanation
Python (FastAPI) + React.jspython-react-fastapiRedisPython (FastAPI) + React
Python (Sanic) + React.jspython-react-sanicRedis

Go

StackTemplateStorageExplanation
Go + React.js + Go-Fitgo-reactMongoDB + RedisGo + React + Go-Fit

The stacks without an explanation page follow the same structure as the documented one for their language — the recommended combination for each language is the one explained above.

What every boilerplate has in common

Whichever stack you choose, the extension is the same shape:

  1. Extension helper library. Handles the install and auth handshake, stores the session, attaches an authenticated platform client to your requests, and verifies webhook signatures. Available for JavaScript, Java and Python; Go uses fdk-extension-go.
  2. Client library. A generated SDK over the Fynd Commerce APIs, used through the platform client the helper library gives you.
  3. Session storage. Where the installed company's tokens live — SQLite for the single-process templates, Redis and/or MongoDB for the production-shaped ones.
  4. A callback URL per launch context. After install, Fynd Commerce redirects the merchant to the URL your auth callback returns, either /company/:company_id or /company/:company_id/application/:application_id.
  5. A React frontend that calls your own backend routes, which in turn call Fynd Commerce.
Which one should I choose?

Pick Node + React to get to a working extension fastest — it needs nothing but Node installed. Pick Node + React + Fit.js or Go + React + Go-Fit if you are building something that has to scale, since both come pre-wired with MongoDB, Redis, structured logging and error reporting.


Was this section helpful?