Installing the SDK on DynamicWeb
Setup Data Sync
For synchronisation of data to Clerk.io, we have to set up a REST API, with access to the necessary data. (Products, Orders, Categories, Pages and Customers).
We will use the Repositories part of DynamicWeb for accessing this.
The files for the REST API are included in the Clerk.io DynamicWeb SDK.
Insert Repository files from the Clerk.io SDK.
Add private key to config file.
Build Repository Index.
Setup the REST API.
Run your first sync to clerk.io.
1. Insert Repository files from the Clerk SDK
In the guide, we will reference THEME_NAME which should be replaced by the name of the used Theme, e.g. Rapido.
In DynamicWeb navigate to Files -> System -> Repositories and create a new subfolder named Clerk.
Copy all of the files from the Repositories folder in the Clerk SDK to the new folder:
Products (Products.index & Products.query)
Categories (Categories.index & Categories.query)
Content (Content.index & Contents.query)
Customers (Customers.index & Customers.query)
Orders (Orders.index & Orders.query)
Navigate to Files -> Templates -> Designs -> THEME_NAME -> QueryPublisher.
Upload the followingfiles from the Clerk SDK to QueryPublisher:
Navigate to Files -> Templates -> Designs -> THEME_NAME.
Copy the friles from thefrom the Rapido folder in the Clerk SDK into the THEME_NAME folder:
2. Add Private Key to config file
In my.clerk.io, navigate to Settings -> API keys.
Copy the Private API key.
Ind DynamicWeb, open ClerkConfig.cshtml that you just copied here.
Replace "##### CLERK Private Key Here #####" with the Private API key.
Save the changes and close.
3. Build Repository Index
Navigate to Settings -> Repositories -> Clerk.
Click the Products index
Under Builds -> Build, click the Products button to build the index.
Follow the same procedure for all indexes (Categories, Contents, Customers, Orders)
4. Setup the REST API
Navigate to Content in the sidemenu and create a new folder named Clerk.
Inside this folder, create a new page
Click Add Empty Page and then choose Page as the type.
Name the page “Products”, and set the Page Status to Hide in menu
Click “New Paragraph” and scroll to Add paragraph. From here, choose App.
Give it the name “Products”.
Choose App > Content > Query publisher
Under Query, choose Products.query.
Under Template in the bottom, choose QueryPublisher/ClerkProducts.cshtml.
In the top of the page, click Save.
In the left menu, click the 3 dots to the right of the Products page, and click Properties.
Under URL, set Exact url for this page to “/clerk/products”.
In the top-menu, uncheck all options above the Accessibility.
Click Layout in top-menu.
In the top menu, choose the template Rapido: JSON
Save the page again.
Repeat these steps for Contents, Orders, Categories and Customers, making sure to replace products/Products with the relevant data type throughout.
5. Run your first sync to clerk.io
Login to your my.clerk.io backend.
Navigate to the Data section.
Insert your webshops domain under Store URL, and choose any additional sync options you want.
Click Start New Data Sync.
Wait for the sync to finish.