Custom endpoint
We already support custom endpoint URLs for our Enterprise customers. Custom endpoints are useful, since it allows you to for example route the traffic through a CloudFlare proxy, granting you some additional control.
While this is a feature we expect to release to self-service customers as well in time, for now this setup requires some co-ordination, which is why it's limited to Enterprise customers.
Client setup
On the front-end, you simply need to pass the api_endpoint with options:
const t = new Thumbmark({ api_endpoint: 'https://your.domain.com' });
Endpoint path
If api_endpoint has no path, ThumbmarkJS appends /thumbmark (so https://your.domain.com becomes https://your.domain.com/thumbmark). If it already includes a path — or ends with a trailing slash — the endpoint is used exactly as given and nothing is appended. The trailing slash is the explicit "use this URL as-is" signal:
// → POST https://your.domain.com/thumbmark
new Thumbmark({ api_endpoint: 'https://your.domain.com' });
// → POST https://your.domain.com/ingest (path present, used as-is)
new Thumbmark({ api_endpoint: 'https://your.domain.com/ingest' });
// → POST https://your.domain.com/ (trailing slash, used as-is)
new Thumbmark({ api_endpoint: 'https://your.domain.com/' });
Preflight-free requests via a proxy
If your proxy attaches the API key and you want to avoid a CORS preflight, set simple_request: true. The call is then sent as a CORS simple request (Content-Type: text/plain, no custom auth headers), and no client-side API key is required. See simple_request in the options reference.
Additional notes
Depending on the setup, this will require some co-ordination with us to ensure it works end-to-end.
If you are an Enterprise client and you need to set this up, please drop us an email