Skip step one if you already have a Rails application you want to use.
1- Create a Rails Application
Create our rails demo application (skipping a bunch of stuff we don’t need).
2- Add gems
We need a way to add environment variables so let’s add dotenv-rails.
Also, add jwt so we can safely authenticate with Embed Workflow.
Create your .env to add the environment variables: EMBED_WORKFLOW_SECRET_KEY, EMBED_WORKFLOW_PUBLISHABLE_KEY, and EMBED_WORKFLOW_USER_KEY.
Replace the environment variables with your test keys. Find them on your account API access page.
3- Create a Workflow Controller
We will create new endpoints (/workflows) but you are not limited to any particular one. Our UI components are your building blocks.
Update the rails router with:
resources:workflows,only: [:index,:new,:show]
To authenticate our components, we will need to generate a JWT token and make it available in our views. Here is an example of how you can accomplish this with a before_action:
4- Loading Resources
The UI Docs will offer more detail to getting set up.
Our views must load Embed Workflow’s external CSS and JS files. You may download and serve locally or use script/link tags.