Bring your own storage
Every scan written straight into object storage you own, announced to your server as it lands. Your storage is the system of record, which also makes the screens and emails around a scan yours to build rather than ours to render. This page is both halves: what the mode is, and how to build what it hands you.
What the mode is
You name a destination and verify it once. From then on, every scan your widget takes is written there as a prefix of its own: the captures, then result.json with the analysis, then a file per set of recommendations as each finishes. Each file is announced on a webhook naming exactly what was written, so your server can read it the moment it hears about it. This mode leans on webhooks more than any other part of the widget, so read Webhooks alongside this page rather than after it.
| Piece | What it is |
|---|---|
| Destination | S3 or S3-compatible, Google Cloud Storage, Azure Blob Storage, or your own SFTP server. Configured under Developers → Scan Storage and verified before your first scan: until verification passes, scans are refused rather than taken and lost |
| Prefix | One per scan, dated, keyed by its batch_id |
| Files | Captures, result.json, recommendations.json, procedures.json. See reading the files |
| Webhooks | scan.completed, recommendation.ready, procedure.ready, each carrying a storage block naming the keys it wrote. See Webhooks |
| Identity | Your own externalUserRef, set on the embed and echoed back on every webhook for that scan, so you can match a scan to a customer in your own system |
The widget becomes a capture device. It takes the photos, the analysis runs, your storage receives it, and the shopper is shown a confirmation rather than a report. Everything they see after that point is yours, which is the trade: the data sits inside your own stack, on your own terms, and the screens and emails around it are yours to write.
What it changes for customers
Nine surfaces move from us to you. None of them is hard on its own, and the table says where each one is rebuilt.
| Surface | An ordinary account | Yours | Rebuild it with |
|---|---|---|---|
| Result screen | Scores, focus areas, the routine | Scan successful, then out of the way | the hand-off and your own endpoint, from result.json |
| Past results and progress | Shopper opens them with an emailed code | Not offered | your own stored scans, which you can gate on a login instead of a code |
| Result email | Sent by Oyster | None | your own send, from your domain |
| Product routine, cart and checkout | Rendered and shoppable inside the widget | Not shown, so nothing is added to a cart | recommendations.json against your catalogue, and your own cart |
| Treatment suggestions | Rendered with a booking call to action | Not shown | procedures.json and your own booking link |
| Post-scan booking prompt | Offered on the result screen | Not offered, since that screen is where it lived | a call to action on your own result screen. The widget's consultation surface still works on its own |
| Review prompt | Asked after the shopper reads their results | Never asked, same reason | your result screen or your email |
| Copy of the report to your team | A second recipient on the result email | None | your own notification, off the same webhook that feeds the email |
| Scan detail in your Oyster dashboard | Every scan, openable, with analytics across them | The scan is counted and billed. Its contents are in your storage | your own reporting, over the rows you keep |
The last screen the shopper sees from us says Scan successful and nothing more. It names no company and promises no results, because when they hear back, and in whose voice, is your decision rather than ours.
What the widget asks for is a separate choice. This mode says where scans are written; Collect from the customer under Scan Settings says what the shopper is asked before one. Leave it on Name, email and phone and those details ride along with the scan. Set it to Nothing and the widget asks for nothing at all, with your externalUserRef as the only identity the scan carries. Decide that on its own terms rather than as a consequence of this one.
The order things happen
Two rules follow from that shape, and most integration bugs here are one of them:
- The browser event is a signal, not data. It tells you a scan happened and which one. The analysis does not exist anywhere you can read it for another few seconds, so a screen that fetches on the event and renders what comes back will render nothing.
- Store before you answer, which is not the same as process before you answer. Write the message down, acknowledge it, and do everything else afterwards. Reading files, building an email, resizing an image and calling your CRM all belong after the response, not inside it. See keeping the handler fast.
Handing off to your screen
Keep the instance you create, and close it when the scan lands. Our widget and yours never need to be open at the same time. The options and callback events used below are the ordinary ones: see events, inline and float modes and matching a scan to your customer on the Web SDK page.
const widget = OysterskinWidget.createUnifiedWidget({
publicKey: 'YOUR_PUBLIC_KEY',
mode: 'inline',
container: '#scan-root',
// Your own id for this shopper, echoed back on every webhook for the scan.
externalUserRef: currentCustomerId,
callback: (message) => {
if (message.event !== 'scanCompleted') return;
widget.close();
// Your view takes the container the iframe just vacated.
renderYourResultScreen(message.data.batch_id);
},
});
Which moment to hand off on
scanCompleted fires the instant the analysis is accepted, before our confirmation screen is painted. Close there and the shopper never sees it, which is usually what you want: one screen saying the scan worked is enough, and it should be yours. If you would rather they confirm first, hand off on minimized instead, which is what our Done button sends.
Inline and float behave differently on close
Inline. close() removes the iframe from your container, which then collapses to nothing. Render into the same element and the transition reads as one screen changing rather than a panel disappearing.
Float. close() also records that the widget was sent away for the rest of the browsing session, so it will not auto-open on the shopper's next page load. That is the right default after a scan. The launcher still renders, and calling open() clears the suppression.
What batch_id is, and what it is not
It is an identifier, not a credential. It arrives in your page's JavaScript, where anyone can read or change it. Send it to your server with your own session or token, and let your server decide what that person is allowed to see. An endpoint that returns a scan to whoever names its batch_id is an endpoint that returns other people's faces.
What to show while you wait
Poll your own API. The scan reaches your server and your storage, not a screen of ours, so your backend is the only thing that knows how far along it is. Expect the analysis within seconds and the routine within about a minute. Show the analysis as soon as it is there and fill the routine in when it arrives, rather than holding the whole screen for the slowest phase. If a phase has not landed after a few minutes, show what you have and let the webhook update it later.
Receiving it on your server
This mode runs on webhooks, so the Webhooks page is the other half of this one. Register the endpoint and keep its secret (registering an endpoint), know the envelope and headers every delivery arrives in (what a delivery looks like), verify the signature over the raw bytes (verifying the signature), and read what happens when you fail or repeat one (retries and ordering). What follows is the shape of a handler for this flow.
app.post('/oyster/scans', express.raw({ type: 'application/json' }), async (req, res) => {
if (!verifyOysterSignature(req.header('Oyster-Signature'), req.body)) {
return res.sendStatus(400);
}
const { event, data } = JSON.parse(req.body.toString('utf8'));
// One row per scan, created by whichever event arrives first.
await db.scans.upsert({
batch_id: data.batch_id,
external_user_ref: data.external_user_ref ?? null,
meta: data.meta ?? null,
prefix: data.storage?.prefix ?? null,
});
for (const object of data.storage?.objects ?? []) {
await db.scanObjects.upsert({ batch_id: data.batch_id, ...object }); // kind, key, bytes, sha256
}
res.sendStatus(200);
// Reading the files, generating the email: after the acknowledgement, off the request.
await queue.add('oyster-scan-phase', { event, batchId: data.batch_id });
});
Delivery is at least once, so key everything on batch_id and make the handler safe to run twice. Treat the three events as three independent arrivals: a scan can produce only some of them depending on what your account has enabled, and the two recommendation events race each other.
Keeping the handler fast
Store means persist the message: one row, or one entry on a durable queue, holding the envelope you were sent. Nothing else. Process means everything you do because of it, and that belongs on the other side of the response.
The number that makes this concrete: we wait three seconds for your reply. A handler that reads result.json, renders an email and resizes a capture before answering will be cut off mid-work, recorded as failed, and retried, and you will do all of it again on the retry. Three attempts later the endpoint is disabled and you are emailed about it, having done the work four times and acknowledged none of it.
// Inside the request: verify, persist, answer. Milliseconds.
await db.deliveries.insert({ id: deliveryId, event, batch_id, payload: raw });
res.sendStatus(200);
// After it: everything that can be slow, retried on your own terms.
await queue.add('oyster-scan-phase', { deliveryId });
If even your write is slow, push the raw body onto a queue and answer from there, then parse in the worker. A 2xx you can produce in milliseconds is worth more than a tidy handler: the message is yours once you have stored it, and the work can take as long as it needs.
The one thing that does belong inside the request is the signature check. It is a hash over bytes you already have, it costs nothing, and answering 2xx to an unverified body means storing whatever anyone chose to send you.
scan.completed carries one field the others do not: a customer block with whatever the widget collected, so your CRM can act on the scan without opening a file first.
"customer": {
"email": "[email protected]",
"first_name": "Ada",
"last_name": "Obi",
"phone_number": "+2348012345678"
}
Only the fields your account collects are present, and the block is absent entirely for an account that collects nothing. There, external_user_ref is the only identity, which is why it is worth setting on the embed before the scan rather than matching afterwards.
Reading the files
We write with the credentials you gave us. Reading is yours: your own credentials, your own destination, whichever SDK you already have. The example below is S3, because it is the most common, but nothing above this line is S3-specific.
import { S3Client, GetObjectCommand } from '@aws-sdk/client-s3';
// Works unchanged against S3 and R2; set the endpoint for R2.
const s3 = new S3Client({
region: process.env.SCAN_BUCKET_REGION,
endpoint: process.env.SCAN_BUCKET_ENDPOINT,
});
async function readJson(key) {
const out = await s3.send(
new GetObjectCommand({ Bucket: process.env.SCAN_BUCKET, Key: key }),
);
return JSON.parse(await out.Body.transformToString());
}
const result = await readJson(`${prefix}result.json`);
The webhook names every key it wrote and is not sent until each one exists, so there is no "not written yet" case to code around. The layout is one prefix per scan, described under the files in your bucket, and listing that prefix gives you the same set if you ever rebuild from scratch.
Four kinds of destination are available, and the storage block on the webhook tells you which one wrote this scan and where, so a handler that reads driver works for all of them:
driver | Destination | Also in the block |
|---|---|---|
s3 |
S3 or anything S3-compatible, including R2 and MinIO | bucket, region, and endpoint when you set one |
gcs |
Google Cloud Storage | bucket, project_id |
azure |
Azure Blob Storage | container, and credential naming which kind of credential your scans travel on |
sftp |
Your own SFTP server | host, root |
Never the credential itself, on any of them. The block is there so you can tell from the delivery where a scan went, and so a handler reading an SFTP drop and an object store can share one code path.
result.json
{
"batch_id": "9f2c...",
"external_user_ref": "cust_8421", // yours, or null
"vendor_id": 140,
"channel": "widget",
"captured_at": "2026-10-20T09:12:41+00:00",
"exported_at": "2026-10-20T09:12:58+00:00",
"customer": { "email": "[email protected]", "first_name": "Ada" },
"images": [
{
"image_id": "front-1",
"label": "front", // front / left / right, or a body region
"is_body": false,
"key": "oyster/scans/2026/10/20/9f2c.../images/front-1a2b3c4d.jpg",
"captured_at": "2026-10-20T09:12:41+00:00",
"analysis": {
"general_skin_health": 72, // 0-100, null when the shot could not be scored
"grade": "Good", // band for the score above
"estimated_skin_age": 27,
"skin_type": { ... },
"skin_tone": { ... },
"categories": [
{
"label": "Hydration & Dryness",
"score": 18, "max_score": 20, "percentage": 90,
"grade": "Good",
"affected_areas": ["cheeks"],
"description": "One sentence on what was observed."
}
],
"detections": [ ... ] // per-finding detail
}
}
],
"quiz_answers": { ... } // what the shopper told the widget, when you ask
}
Render grade rather than re-deriving a band from the number, so your result screen, your email and anything you export later all say the same thing. A null general_skin_health means the shot could not be scored: show "not assessed", never 0. There is no image URL in here on purpose: the captures are in your own destination, so the key is what you are given and the URL is yours to mint.
recommendations.json and procedures.json
// recommendations.json
{
"batch_id": "9f2c...", "vendor_id": 140,
"generated_at": "2026-10-20T09:14:02+00:00",
"products": [
{
"product_id": 8812, "brand_name": "...", "product_name": "...",
"category": "cleanser", "step_number": 1,
"recommendation_type": "best", // best | primary | alternative | chatbot | null
"fit_percentage": 92,
"body_region": null, // null for a face routine
"usage": { // an object, not a line of text
"when_to_use": "morning and evening",
"frequency": "daily",
"schedule": { "type": "daily", "label": "Every day" },
"how_to_apply": [...],
"why_this_product_fits": "...",
"precautions": "...",
"expected_timeline": "..."
},
"goals": [...], "target_concerns": [...],
"min_price": 7500, "max_price": 7500, "currency": "NGN",
"image_path": "products/...jpg" // null when you do not stock it
}
// more than one row can share a step_number. See Building the routine.
]
}
// procedures.json
{
"batch_id": "9f2c...", "vendor_id": 140,
"generated_at": "2026-10-20T09:14:40+00:00",
"procedures": [
{
"procedure_id": 44, "procedure_name": "...",
"priority": 1, "fit_percentage": 88,
"goals": [...], "details": "...",
"estimated_price": 45000, "currency": "NGN"
}
]
}
Both are written even when the list is empty, so a consumer waiting on the file is never waiting forever. Products come ordered by step_number and treatments by priority: render them in the order given, since it is the routine's own order rather than a ranking you should re-sort.
Keeping it in your database
You do not have to copy the analysis into your own tables, but you do need enough to find a scan, know what state it is in, and link it to a customer. A minimum that holds up:
create table oyster_scans (
batch_id text primary key,
customer_id bigint references customers(id), -- resolved from external_user_ref
external_user_ref text,
meta text,
prefix text not null,
captured_at timestamptz,
scan_ready_at timestamptz, -- scan.completed handled
products_ready_at timestamptz, -- recommendation.ready handled
procedures_ready_at timestamptz, -- procedure.ready handled
email_sent_at timestamptz, -- so a retried delivery cannot send twice
summary jsonb -- the few fields your UI and email read
);
create table oyster_scan_objects (
batch_id text references oyster_scans(batch_id),
kind text not null, -- image | result | recommendations | procedures
key text not null,
bytes integer,
sha256 text,
primary key (batch_id, key)
);
A few things worth deciding deliberately rather than by default:
- Keep keys, not images. Photographs belong in the bucket. Store the key and sign a URL when something needs to show one.
- Denormalise only what you read. A small summary (score, grade, top concerns, routine step count) keeps a list page and an email template off the bucket entirely. Read the full file when somebody opens the detail view.
- Put contact details where your contacts already live. This is your customer, and the scan is one more thing you know about them. A second copy of their email inside the scan row is a second place to honour a deletion request from.
- Set a retention rule on the destination. Captures are the most sensitive thing in this flow and the easiest to forget. Decide how long you need them and let a lifecycle rule enforce it, or schedule the equivalent sweep if you receive them over SFTP. Nobody else can expire them for you: the files are in your account.
- Record the consent yourself if you need the record. The shopper accepted the pre-scan notice you wrote, in our widget. If your compliance depends on being able to produce who agreed to what and when, stamp it on the scan row as you ingest it, where the rest of your evidence already lives.
Serving it to the shopper
One endpoint of your own, authorised the way the rest of your account area is, is enough. The scan is already keyed to a customer by the time your screen asks for it.
app.get('/api/scans/:batchId', requireLoggedInCustomer, async (req, res) => {
const scan = await db.scans.findByBatchId(req.params.batchId);
// The shopper's session decides this, never the id in the URL.
if (!scan || scan.customer_id !== req.customer.id) return res.sendStatus(404);
res.json({
status: {
analysis: Boolean(scan.scan_ready_at),
products: Boolean(scan.products_ready_at),
procedures: Boolean(scan.procedures_ready_at),
},
...(scan.scan_ready_at ? await buildResultView(scan) : {}),
});
});
Returning the per-phase status, rather than 404 until everything is ready, is what lets one screen show the analysis immediately and slot the routine in a minute later without a second design.
Keep the destination private. Serve captures through a signed URL you mint per request, or proxy them through your own route, and keep that link out of anything cacheable by a CDN. A destination left publicly readable is the one mistake in this integration that cannot be walked back, because it is other people's faces.
Progress over time
A shopper's second scan is more interesting than their first, and this is the surface the arrangement costs you most visibly. Rebuilding it is mostly free, because you already keep one row per scan against a customer: order those rows by captured_at and you have the timeline.
What to chart, in order of how much it says: the headline general_skin_health per scan, then the same per categories[].percentage so a shopper can see hydration improving while pigmentation holds, then the per-category grade as a label rather than a number. Two scans is a direction; three is a trend worth drawing.
select s.batch_id, s.captured_at,
(s.summary->>'general_skin_health')::int as score,
s.summary->'categories' as categories
from oyster_scans s
where s.customer_id = $1 and s.scan_ready_at is not null
order by s.captured_at;
Our own version of this screen puts an emailed code in front of it, because a widget on someone else's site has no session to trust. Yours does: whoever is logged in is who they say they are, so the code step is one of the few things you do not have to rebuild.
Building the routine the customer sees
recommendations.json is every row the generator produced, not the list to render. Several rows can share one step_number: a primary product, alternatives behind it, and sometimes two products that swap days rather than compete. Render the file as it comes and your customer sees three cleansers in step one and no way to tell which is theirs.
Our own surfaces narrow it server-side before any of them draw it, so the widget, the email and the dashboard cannot disagree. The rule, per body_region and step_number:
- Drop any row whose recommendation_type is chatbot. Those are products named in a chat, stored against the same scan, and they are not part of the routine.
- A row typed best or primary, or with no type at all, is a candidate to be the step's product. A row typed alternative never is.
- Pick one candidate per step: best outranks the others, then the highest fit_percentage, then whichever came first in the file.
- A step whose only rows are alternatives has no product. Drop the step rather than promoting an alternative into it.
- The remaining alternatives are the "or this instead" list behind the chosen product. Show them as a secondary list if you want them, never as steps of their own.
const type = (p) => (p.recommendation_type ?? '').trim().toLowerCase();
const CANDIDATE = new Set(['best', 'primary', '']);
const rank = (p) => (type(p) === 'best' ? 1e6 : 0) + (p.fit_percentage ?? 0);
function routineToShow(products) {
const groups = new Map();
for (const p of products) {
if (type(p) === 'chatbot') continue;
const key = `${p.body_region ?? 'face'}|${p.step_number}`;
groups.set(key, [...(groups.get(key) ?? []), p]);
}
const steps = [];
for (const rows of groups.values()) {
const candidates = rows.filter((p) => CANDIDATE.has(type(p)));
if (candidates.length === 0) continue; // alternatives with no primary
const product = candidates.reduce((a, b) => (rank(b) > rank(a) ? b : a));
steps.push({
step: product.step_number,
region: product.body_region ?? null,
product,
alternatives: rows.filter((p) => p !== product && type(p) === 'alternative'),
});
}
return steps.sort((a, b) => a.step - b.step);
}
Two products that swap days
One case is not a duplicate and must not be collapsed. When two best products on the same or an adjacent step have schedules that never land on the same day, they are a swap: an exfoliating cleanser on Monday, Wednesday and Friday and a gentle one on the other days, or two actives on disjoint weekday sets. Both belong on the screen, each labelled with its own days. Show only the higher-ranked one and the customer is told to use an active every day that we deliberately spaced out.
usage.schedule is what tells you, and it is machine-readable:
"schedule": {
"type": "interval", // daily | interval | weekly
"interval_days": 2, // interval: every Nth day
"phase": 1, // interval: 0 and 1 on the same interval never coincide
"days_of_week": [], // weekly: ISO days, 1 = Monday
"label": "Every other day" // ready to render as-is
}
// Conservative: anything this cannot prove disjoint is treated as competing,
// so the worst case is one product per step rather than two shown in error.
function canShareADay(a, b) {
const x = a.usage?.schedule, y = b.usage?.schedule;
if (!x || !y) return true; // absent reads as daily
if (x.type === 'daily' || y.type === 'daily') return true;
if (x.type === 'weekly' && y.type === 'weekly') {
return x.days_of_week.some((d) => y.days_of_week.includes(d));
}
if (x.type === 'interval' && y.type === 'interval') {
return !(x.interval_days === y.interval_days && x.phase !== y.phase);
}
return true;
}
Render label rather than deriving your own wording from the numbers: it is the phrasing the rest of the routine is written against, and it already reads as a sentence.
What to put under each product
usage is an object, not a line of text, and most of a good routine screen is already written inside it:
| Key | What it is |
|---|---|
when_to_use | Morning, evening, or both |
frequency, frequency_detail | How often, in words |
schedule | The same cadence, machine-readable. See above |
how_to_apply | The steps for this product |
why_this_product_fits | One line tying it to their own result. The highest-value sentence on the screen |
precautions | What to avoid pairing it with, or when to stop. Render it if you render nothing else from here |
expected_timeline | When to expect a change, which is what stops a customer abandoning the routine in week two |
application_order | Where it sits among the others, when a step holds more than one |
Keys are present when the generator wrote them and absent otherwise, so read defensively and let a missing one collapse its line rather than printing a label with nothing after it.
Matching recommendations to your catalogue
recommendations.json names products rather than linking to them, so the routine is only shoppable once you have joined it to your own catalogue. Join on product_id, which is stable for a given product across scans, and keep the mapping to your own SKU in one table rather than matching on names at render time.
create table oyster_product_map (
oyster_product_id bigint primary key,
sku text not null,
mapped_at timestamptz not null default now()
);
- A null product_id is not a bug. It means the suggestion is a product you do not sell, offered so the step is not left empty. Decide once whether those appear on your screen as advice or are dropped, and be consistent: a step that silently vanishes reads as a shorter routine, not a missing product.
- Render your own images and prices. image_path is the catalogue image for the matched product and is null for anything you do not stock. Your storefront already has a better image and the only price that is definitely current, so prefer both and treat the file's min_price and max_price as the band the recommendation was made inside.
- Narrow the rows before you match them. Several rows can share a step, so join to your catalogue after you have picked what to show rather than before. See building the routine. Keep step_number as the order the routine is applied in rather than a ranking: a grid of products sorted by price is a different, worse product.
- Add to cart is yours now. The widget's cart lived on the result screen, so there is nothing to intercept: wire your own add-to-cart against the mapped SKUs, and you get your real stock, prices and promotions for free.
procedures.json needs the same treatment with less work, since a treatment is usually a page or a booking type on your side rather than a stock item. Join on procedure_id and use priority as the order to present them in.
Reporting and analytics
Your Oyster dashboard still shows that a scan happened, and bills it. What it cannot show is what was in it, so any question about results is one only your own copy can answer. That is the trade this arrangement makes, and it is worth planning for on day one rather than discovering a quarter later with nothing stored.
The summary column earns its place here. Scores and category percentages lifted out of each result.json at ingest time are what let you answer, in one query, the questions that actually come up:
- Which concerns are most common among the people who scan, by month and by branch.
- Whether scores move for customers who came back, and which routines they were on.
- Which recommended products were bought, by joining your own orders on the SKU map.
- How many scans produced a booking, if you offer treatments.
Scans on your invoice and scans in your database should agree. The invoice counts what the widget completed; your tables count what you stored. A month where the two differ is a webhook you answered and did not persist, and reconciling monthly catches it while the prefix is still there to replay from.
Sending the result email
We send no result email for your account, and no follow-up of any kind about the scan. The message the shopper gets is entirely yours: your domain, your template, your sending reputation.
One mail can still leave our side, and it is usually the one you want kept. If your customers pay for their own scans and Email payment receipts to users is on under Scan Settings, we email them proof of payment and the reference that recovers an undelivered scan. It carries no scan data. Turn it off there if you would rather send that yourself too.
When to send
Send on recommendation.ready rather than scan.completed. A scan email with scores and no routine is the weaker message, and the routine is usually a minute behind (see the events and their timing). If you offer treatments too, decide which of the two you are waiting for and say so in your own job, rather than letting whichever lands first send a half-complete email.
// In the worker, after the file is read and stored.
async function maybeSendResultEmail(batchId) {
const scan = await db.scans.findByBatchId(batchId);
if (scan.email_sent_at) return; // retries must not send twice
if (!scan.scan_ready_at) return; // nothing worth reading yet
const waitingForProducts = offersProducts && !scan.products_ready_at;
const waitingForTreatments = offersTreatments && !scan.procedures_ready_at;
// Give the slower phase a few minutes, then send what you have rather than
// nothing: a phase can fail on our side and be retried well behind the scan.
const young = Date.now() - Date.parse(scan.scan_ready_at) < 5 * 60 * 1000;
if ((waitingForProducts || waitingForTreatments) && young) return;
await sendResultEmail(scan);
await db.scans.update(batchId, { email_sent_at: new Date() });
}
The email_sent_at check is doing real work. Deliveries retry, both recommendation events can call the same worker, and a scheduled sweep for stragglers will call it again. Make sending the one step that cannot happen twice.
Where the address comes from
From the customer block on scan.completed, or from your own records via external_user_ref. Prefer your own: it is the address the shopper already confirmed with you, and it is the one they manage their preferences against. If your account collects nothing, your records are the only source, and a scan that arrives with a reference you cannot resolve has nobody to email.
Putting the shopper's own photo in an email
Possible, and worth thinking about twice. If you do it, serve the image through a route of your own with a signed, expiring token rather than a presigned bucket URL: presigned S3 links top out at seven days, and an email outlives that in most inboxes. A link that 401s a fortnight later reads as a broken brand rather than a careful one.
A photograph in an email also sits in whatever archive that mailbox keeps, which is a decision you are making on the shopper's behalf. The safer default is to lead with the scores and the routine and keep the captures behind a login on your own page, linked from the email.
What to put in it
- Their first name, the date of the scan, and the one headline number with its grade. Enough that the email is obviously theirs and obviously about the thing they just did.
- Two or three focus areas, worst first, each with the one-sentence description from the category. The file gives you that sentence; you do not have to write it.
- The routine as named steps in order, with products you actually stock. A routine that links to an empty product page is worse than a shorter routine.
- One call to action, to your own result screen. Keep the full report on the web, where you can update it when the treatments file lands.
Send it from your own domain with SPF, DKIM and DMARC aligned, through whatever you already use for order confirmations rather than a new sender nobody has seen before. A scan the customer asked for is transactional, but a routine of products or treatments to buy is marketing in some jurisdictions and under some of your own customers' preferences, so apply the consent flags you already hold.
Before you go live
| Step | Where |
|---|---|
| Destination configured and verified | Developers → Scan Storage. Verification writes and deletes a probe object. Until it passes we refuse scans rather than take one and lose it |
| Endpoints registered, secrets stored, test delivery seen | Developers → Webhooks, and registering an endpoint |
| externalUserRef set per shopper | Your embed, before the scan starts |
| Handler persists before it answers 2xx, inside three seconds, and is safe to run twice | Your server. See keeping the handler fast |
| Both recommendation events handled independently | Your server. See the events |
| Result screen authorises by session, not by batch_id | Your API |
| Routine narrowed to one product per step before it is rendered | Your result screen. See building the routine |
| Email trigger, de-duplication and image strategy decided | Your worker |
| Retention rule on the destination | Your cloud account, or your own housekeeping on an SFTP drop |
If something here does not match what you are seeing, the delivery log under Developers → Webhooks shows every attempt with its response, which settles most of it in a minute. For anything it does not, contact support with the batch_id.