staq v0.11.0
staq
Staq is a Javascript library for creating Software-as-a-Service (SaaS) businesses.
The staq
package contains a set of React components that implement standard SaaS features including:
- User accounts
- Landing page
- Pricing page
- Subscription management (via Stripe Customer Portal)
The package also ships with a set of NodeJS functions to be used with Google Firebase to implement the backend logic necessary for features like subscription billing with Stripe.
Quickstart
Install
yarn add staq
Initialize and configure
In your
index.js
, add the following import:import { initStaq, withStaq } from staq
Call
initStaq
and pass in a configuration object specifying the name of your site and your Firebase config object.initStaq({ siteTitle: 'Test App', firebaseConfig: { // your firebase config } })
Also in
index.js
, wrap your app inwithStaq
Take the first argument toReactDOM.render
and pass it to thewithStaq
function.```jsx ReactDOM.render( withStaq(<App />), document.getElementById('root') ) ```
Use
staq
to install standard SaaS features In yourApp.js[x]
, importStaqRoutes
and render them inside your router.```jsx import React from 'react' import { BrowserRouter as Router } from 'react-router-dom' import { StaqRoutes } from 'staq' function App(props) { return ( <Router> <StaqRoutes /> </Router> ) } export default App ```
License
MIT © mroll