Quick Start

To begin, please clone the repository and and drag all the assests from public and then drag the sdk folder from the src folder to your project's src folder.

Next, in your main.jsx file import BeanXPRouter from sdk.jsx and wrap it around your app. This is so if there are any errors in the entirety of your App, it will use beansites error handler and use beansites loading screen.

The following is code is a good example:

main.jsx
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.jsx';
import "./stylesheets/style/default.css"; // if u have one
import { BrowserRouter, Route, Routes } from "react-router-dom";
import { BeanXPRouter } from './sdk/sdk.jsx';
InitializeGoogleAnalytics();
ReactDOM.createRoot(document.getElementById('root'))
.render(<BeanXPRouter>
  <BrowserRouter basename='/'>
    <Routes>
      <Route path="" element={<App/>}/>
    </Routes>
  </BrowserRouter>
</BeanXPRouter>);

This example includes react-router-dom to plan ahead if you plan to have multiple instances. otherwise, ignor it entirely. Wrapping the router in our router adds our loading screen to all pages.

Next, In your App.jsx get started by wrapping the app in the BeansiteXP component. then import the Window component. Both of these have parameters thatt make them modular. Here as an example of how you would configure this usually:

What you say was some of the parameters you will use the most. There are more, and you will probably use them as well. To learn more, refrence the Window component doc. Heres what a standard here what a standard App.jsx file will look like:

By now you should have a completly working Beansite App. If you don't, it's probably my fault for not sleeping. For more info, check out the components and their docs.

Last updated