Skip to main content
This guide describes how to integrate the embedded shopping experience and what is required to set it up. The embedded shopping experience allows a Group or Clinic to “host” Vetcove’s Home Delivery shopping portal directly within a mobile app using an iFrame or WebView. This provides a seamless, native-like experience while enabling auto-authentication for users (clients) and deep-linking into specific parts of the online storefront, such as checkout.
If you encounter any issues configuring the embedded shopping experience, we’re here to help! Please reach out to your onboarding specialist for assistance.

Getting started

Requirements

To set up the embedded shopping experience, you will need:
  • An API Key (Instructions on how to get one available in Getting started with API Keys)
  • A list of live clinic IDs
  • A backend server to handle authentication requests
  • Your mobile app to integrate the WebView or iFrame

API overview

The integration requires two API calls:
  1. Generate an auto-authentication token for a client using this API.
  2. Create a Client and Patient (only if the client does not exist in our system).
API calls should be made from your backend server to prevent exposing the API Key in frontend code or bundles. DO NOT expose the API Key in your mobile app.

API flow

1

Step 1: Request an Auto-Authentication Token

To authenticate a client, make a POST request to the /ext/v2/accounts/auto-auth/ endpoint.

Request payload

You must provide a clinic_id (Clinic ID of the associated Clinic) and either client_email or client_phone_number. If both are available, we recommend using client_phone_number.
Or, using a phone number:

Successful response

If the request is valid, the API will return an authentication token and relevant URLs.
If the request is successful, you can skip Step 2 and proceed to Step 3.

Error responses

  • 401 Unauthorized: Invalid API token. Verify the token and header format.
  • 400 Bad Request: Invalid JSON payload or validation errors.
  • 404 Not Found: No client exists for the provided details. Proceed to Step 2 to create a Client and Patient.
2

Creating a Client and Patient

If Step 1 resulted in a 404 Not Found, you must create a Client and Patient in our system before retrying authentication.Make a POST request to the /ext/v2/clinic-clients/ endpoint.

Request payload

Successful response

Once you receive a 201 Created response, return to Step 1 and request an authentication token using the newly created Client’s email or phone number.
3

Step 3: Using the Auto-Authentication Token

🚧 Ensure you received an auth token before proceeding! If Step 1 failed, check your payload or return to Step 2 to create a Client and Patient.
Once you receive a successful response, take the embed_url and return it in your API response for the WebView or iFrame integration.

Implementing in React Native

Backend integration

Before implementing the WebView, you’ll need to create a backend API endpoint that handles the authentication flow described in Steps 1 and 2. This endpoint should:
  1. Accept client information from your mobile app
  2. Make the POST request to /ext/v2/accounts/auto-auth/ with your API key
  3. Handle the 404 response by creating a new client if needed (Step 2)
  4. Return the embed_url to your mobile app
In the React Native example below, we assume you have created an endpoint at https://api.your-backend.com/vetcove-auth that implements this logic. Replace API_URL in the example with your actual backend endpoint URL.
Never call the Vetcove API directly from your mobile app. Always proxy requests through your backend to keep your API key secure.

React Native WebView example

WebView best practices

To enhance the WebView experience, use the following recommended props:
These settings help ensure a smooth and seamless embedded shopping experience.
Set allowsInlineMediaPlayback and mediaPlaybackRequiresUserAction for iOS. Without allowsInlineMediaPlayback, storefront videos open in the native full-screen player on iPhone instead of playing inline. Without mediaPlaybackRequiresUserAction={false}, muted background videos won’t autoplay. See the react-native-webview reference for details.