Skip to content

Commit

Permalink
Update readme to include javascript instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
candanedo committed Feb 15, 2024
1 parent 36c1f19 commit 40b1c08
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ Find your project ID in the Overview tab of any Integration.

Once this information is configured in your Rails project, you can start using the gem as needed.

## Javascript assets (Paragon SDK)

The UseParagon gem includes the JavaScript assets necessary for you to utilize the Paragon SDK. To use window.paragon.authenticate(project, token) or window.connect(integration_name, options) in your JavaScript, you need to require the assets.

#### Using Importmaps
If you're using importmaps, add the following line to your config/importmap.rb file:

```ruby
pin "useparagon/connect" # 3.1.2
```
This will ensure that the necessary JavaScript asset is included in your application.

If you're using Stimulus controllers, you can require the asset in your desired controllers:

```js
import "useparagon/connect"
```

### Workflow triggers
#### Request trigger

Expand Down

0 comments on commit 40b1c08

Please sign in to comment.