Installing the SDK on DynamicWeb

Clerk has built an SDK that can be used as the foundation for syncing a DynamicWeb Store with Clerk

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.

  1. Insert Repository files from the Clerk.io SDK.

  2. Add private key to config file.

  3. Build Repository Index.

  4. Setup the REST API.

  5. 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.

  1. In DynamicWeb navigate to Files -> System -> Repositories and create a new subfolder named Clerk.

  2. Copy all of the files from the Repositories folder in the Clerk SDK to the new folder:

  3. Products (Products.index & Products.query)

  4. Categories (Categories.index & Categories.query)

  5. Content (Content.index & Contents.query)

  6. Customers (Customers.index & Customers.query)

  7. Orders (Orders.index & Orders.query)

  8. Navigate to Files -> Templates -> Designs -> THEME_NAME -> QueryPublisher.

  9. Upload the followingfiles from the Clerk SDK to QueryPublisher:

  10. ClerkProducts.cshtml

  11. ClerkCategories.cshtml

  12. ClerkContents.cshtml

  13. ClerkCustomers.cshtml

  14. ClerkOrders.cshtml

  15. Navigate to Files -> Templates -> Designs -> THEME_NAME.

  16. Copy the friles from thefrom the Rapido folder in the Clerk SDK into the THEME_NAME folder:

  17. ClerkConfig.cshtml

  18. Json.cshtml

2. Add Private Key to config file

  1. In my.clerk.io, navigate to Settings -> API keys.

  2. Copy the Private API key.

  3. Ind DynamicWeb, open ClerkConfig.cshtml that you just copied here.

  4. Replace "##### CLERK Private Key Here #####" with the Private API key.

  5. Save the changes and close.

3. Build Repository Index

  1. Navigate to Settings -> Repositories -> Clerk.

  2. Click the Products index

  3. Under Builds -> Build, click the Products button to build the index.

  4. Follow the same procedure for all indexes (Categories, Contents, Customers, Orders)

4. Setup the REST API

  1. Navigate to Content in the sidemenu and create a new folder named Clerk.

  2. Inside this folder, create a new page

  3. Click Add Empty Page and then choose Page as the type.

  4. Name the page “Products”, and set the Page Status to Hide in menu

  5. Click “New Paragraph” and scroll to Add paragraph. From here, choose App.

  6. Give it the name “Products”.

  7. Choose App > Content > Query publisher

  8. Under Query, choose Products.query.

  9. Under Template in the bottom, choose QueryPublisher/ClerkProducts.cshtml.

  10. In the top of the page, click Save.

  11. In the left menu, click the 3 dots to the right of the Products page, and click Properties.

  12. Under URL, set Exact url for this page to “/clerk/products”.

  13. In the top-menu, uncheck all options above the Accessibility.

  14. Click Layout in top-menu.

  15. In the top menu, choose the template Rapido: JSON

  16. Save the page again.

  17. 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

  1. Login to your my.clerk.io backend.

  2. Navigate to the Data section.

  3. Insert your webshops domain under Store URL, and choose any additional sync options you want.

  4. Click Save.

  5. Click Start New Data Sync.

  6. Wait for the sync to finish.