|
1 | 1 | --- |
2 | 2 | title: Using Shepherd Pro |
3 | | -description: A guide to using the Pro feature of Shepherd. |
| 3 | +description: A guide to using Shepherd Pro |
4 | 4 | --- |
5 | 5 | import { Tabs, TabItem } from '@astrojs/starlight/components'; |
6 | 6 |
|
@@ -35,31 +35,36 @@ First, you'll need to install the Pro package: |
35 | 35 | </Tabs> |
36 | 36 |
|
37 | 37 |
|
38 | | -Before you create a new `Tour` instance, add your key via the `init` method: |
| 38 | +To get started, add your key via the `init` method: |
39 | 39 |
|
40 | 40 | ```javascript |
41 | 41 | import Shepherd from '@shepherdpro/pro-js'; |
42 | 42 |
|
43 | 43 | Shepherd.init({YOUR API KEY}); |
44 | | - |
45 | | -const journey = new Shepherd.Tour({ |
46 | | - ... |
47 | | -}); |
48 | 44 | ``` |
49 | 45 |
|
50 | | -The second thing needed is to create an instance in the Pro portal, which will give you an ID to add to the tour. |
| 46 | +Then, if you've created journeys in the application and added targeting that is |
| 47 | +met, a journey will be shown to your user. Otherwise, you can also still programmatically |
| 48 | +start a journey in your application by using the `startJourney` method and passing the ID |
| 49 | +of the journey. |
51 | 50 |
|
52 | 51 | ```javascript |
53 | | -const journey = new Shepherd.Tour({ |
54 | | - id: 'custom-123', |
55 | | - defaultStepOptions: { |
56 | | - cancelIcon: { |
57 | | - enabled: true |
58 | | - }, |
59 | | - classes: 'my-custom-class' |
60 | | - }, |
61 | | - useModalOverlay: true |
62 | | -}); |
| 52 | +Shepherd.`startJourney`('custom-UUID'); |
63 | 53 | ``` |
64 | 54 |
|
65 | | -Then you just need to add steps to the journey instance and trigger the start method to begin. Shepherd Pro will take care of the rest and capture events in the portal. |
| 55 | +### startJourney() |
| 56 | + |
| 57 | +> **startJourney**(`id`): `Promise`\<`Tour | undefined`\> |
| 58 | +
|
| 59 | +Start the journey by ID, if found |
| 60 | + |
| 61 | +#### Parameters |
| 62 | + |
| 63 | +• **id**: `string` |
| 64 | + |
| 65 | +#### Returns |
| 66 | + |
| 67 | +`Promise`\<`Tour | undefined`\> |
| 68 | + |
| 69 | + |
| 70 | +*** |
0 commit comments