Aller au contenu

Mettre en route Canopus avec votre assistant

Si vous codez avec un assistant, vous ne lisez pas cette documentation pour brancher Canopus. Vous branchez l’assistant une fois, puis vous collez le prompt que vous donne chaque étape du guide de mise en route. Il travaille dans votre dépôt et dans Canopus par le serveur MCP ; vous gardez les clics qui vous reviennent par construction, et chaque validation.

Comment ça marche

Le guide de mise en route (la page Mise en route de votre projet) montre chaque étape avec un bouton « Faire avec mon assistant ». Le prompt qu’il copie est rempli avec votre projet, jamais avec un secret : quand l’assistant a besoin d’une clé, le prompt nomme la variable d’environnement où vous l’avez mise.

Le premier moment est juste après le paiement. Pendant que Canopus écrit votre stratégie, l’écran crée en un clic une clé pour l’assistant (elle lit, écrit des brouillons et des contacts, et n’envoie aucun e-mail), vous donne la commande Claude Code avec cette clé, et un seul prompt qui installe la mesure, le domaine d’envoi et vos utilisateurs existants. Vous lisez votre stratégie pendant qu’il travaille.

L’assistant travaille sur une branche et ne pousse ni ne déploie jamais : il vous dit quoi déployer.

Brancher l’assistant

  1. Claude Code, dans le dépôt de votre SaaS

    Créez une clé d’API avec les permissions Lecture, Écrire des brouillons, Écrire des contacts et Envoyer des événements produit, mettez-la dans votre environnement sous CANOPUS_API_KEY, puis lancez la commande ci-dessous dans le dépôt.

  2. Claude Desktop, claude.ai ou un autre client MCP

    Ajoutez Canopus comme connecteur personnalisé avec l’adresse du serveur ci-dessous, connectez-vous et choisissez le SaaS. Aucune clé à copier.

  3. Vérifier

    Posez une question sur Canopus à votre assistant. Le guide coche l’étape au premier appel.

claude mcp add --transport http canopus https://www.canopushq.io/api/mcp \
  --header "Authorization: Bearer $CANOPUS_API_KEY"

L’ordre, et qui fait quoi

Les étapes viennent dans l’ordre où l’assistant en termine le plus. Une étape « vous, puis l’assistant » attend un clic de votre part (un secret, un domaine), puis l’assistant fait le reste.

ÉtapeQuiCe qui se passe
StripeVousVous connectez votre compte avec une clé en lecture seule.
Votre assistantVousVous lancez une commande ou ajoutez un connecteur.
L’entretienL’assistantIl répond aux questions auxquelles votre code et votre site répondent, et corrige la description du produit. Possible dès qu’un abonnement couvre le projet.
La mesureL’assistantIl crée la clé du site et pose le snippet sur vos pages publiques, à l’écart des clients connectés.
Le webhook CRMVous, puis l’assistantVous générez le secret ; il écrit l’intégration qui envoie les inscriptions, l’activité et les paiements.
L’activation et l’adoptionL’assistantIl propose les moments où un utilisateur trouve la valeur, les envoie depuis votre serveur et règle l’activation.
Le domaine d’envoiVous, puis l’assistantVous ajoutez le domaine ; il lit les enregistrements DNS et les publie s’il a accès à votre DNS.
Les contactsL’assistantIl fait entrer vos utilisateurs existants dans le CRM.
Les e-mails transactionnelsL’assistantIl fait passer les e-mails de votre produit par l’API Canopus, l’ancien envoi gardé derrière un interrupteur.
Le logoVousVous vérifiez le logo en tête de vos e-mails.
Le sondageL’assistantIl écrit le sondage NPS ; vous l’activez.
Le test A/BL’assistantIl prépare un test sur un titre ; vous le lancez.
Le suivi des erreursL’assistantIl pointe votre SDK Sentry vers Canopus, ou en installe un, et vérifie qu’une erreur de test est arrivée.

Les prompts

Dans le produit, chaque prompt porte le nom de votre SaaS. Ils sont écrits en anglais parce qu’un assistant de code les lit ; l’assistant vous répond dans votre langue.

Juste après le paiement : tout ce qui n’attend pas la stratégie

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Set up Canopus for my SaaS while Canopus writes my strategy. Do the parts below in order. When one waits for a click of mine in Canopus, tell me which one and go on to the next part.

Part 1. Measurement.
1. Call set_up_site_measurement. It returns the snippet with the site key (public by design).
2. Put the snippet in the <head> of every public page, once, in the layout.
3. If the public site and the signed-in product are the same application, load the script only for visitors who are not signed in: the snippet has no identify() call, so otherwise every customer who opens the product counts as a visitor, every day.
4. On the actions that matter for growth on the public pages (starting a sign-up, choosing a plan), call window.canopus('name'), guarded in case window.canopus does not exist. Names start with a letter: letters, digits, _ . : - only.
5. Remove no other analytics tool.

Part 2. Sending domain.
1. Call get_sending_domain_status.
2. If no domain is added yet, tell me to add it in Canopus, Settings, Sending domain, and come back to this part when I say it is done.
3. Otherwise, publish the records it returns (name, type, value) exactly as given if you can reach my DNS provider from here, touching no other record; if you cannot, give me a table to copy.
4. If an SPF or DMARC record already exists on the same name, do not overwrite it: tell me, and show the merged value.

Part 3. Existing users.
1. Find where users live in this codebase (database, auth provider) and count them. Do not run anything yet.
2. If the CRM webhook is wired (CRM_WEBHOOK_SECRET in the environment), write a one-off script that sends user.created for each existing user, signed like the integration, with a stable event_id per user, in small batches. Show it to me and run it only when I confirm.
3. If it is not wired, tell me the webhook page in Canopus (CRM, Settings, Webhook) gives the secret and its own prompt. If there are fewer than fifty users, you may instead use upsert_contact for each, then search_contacts to check.
4. Never put the user list in this conversation.

To finish, give me in one short list: what you changed and on which branch, what I must deploy, and each click still waiting for me. After I deploy, call get_measurement_setup to check that the first page views arrive.
The next steps (activation, transactional email, survey, A/B test) have their own prompts in Canopus, on the Setup page. Reference: https://www.canopushq.io/en/docs/assistant

L’entretien

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Answer the Canopus onboarding interview for me, from what this repository and the public site actually show.

1. Call get_strategy_interview to see the questions in order and what is already answered.
2. Call get_product_profile. If the product description is wrong or incomplete, correct it with set_product_description.
3. For each unanswered question the code or the site truly answers (who it is for, the price, the main competitor, how people find it), call answer_onboarding_question.
4. Never invent: a question only I can answer (my goal, my budget, my numbers) stays empty.

End with the list of questions still waiting for me. Sending the answers and asking for the strategy stay on the Canopus screen.
Reference: https://www.canopushq.io/en/docs/onboarding

La mesure

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Install Canopus measurement in this repository.

1. Call set_up_site_measurement. It returns the snippet with the site key (public by design).
2. Put the snippet in the <head> of every public page, once, in the layout.
3. If the public site and the signed-in product are the same application, load the script only for visitors who are not signed in. The snippet has no identify() call: otherwise every customer who opens the product counts as a visitor, every day.
4. On the few actions that matter for growth on the public pages (starting a sign-up, choosing a plan), call window.canopus('name'), guarded in case window.canopus does not exist. Names start with a letter: letters, digits, _ . : - only.
5. Remove no other analytics tool.

Then call get_measurement_setup after I deploy, to check that the first page views arrive.
Reference: https://www.canopushq.io/en/docs/measurement

L’activation et l’adoption

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Give Canopus my product's real usage, so activation and feature adoption mean something.

1. The server key is in the CANOPUS_API_KEY environment variable (scope events:write). If it is missing, stop and tell me to create one in Canopus, Settings, API.
2. Read the code and propose two or three moments where a user gets the value of the product (for example a first project created, a first import done). Wait for my choice before writing anything.
3. Send each chosen moment from the server to POST https://www.canopushq.io/api/v1/events, with my own user id as userId, the email, and a stable eventId so a retry never counts twice. Send in the background: a failure must never block the user.
4. From now on, each time a feature ships, send one server event named after it (snake_case), so Canopus can show its adoption without any setup.
5. Do not send user.created or activity this way: the CRM webhook already carries them.

Once events have arrived, call get_measurement_setup, then set_measurement_events to set the activation event I chose.
Reference: https://www.canopushq.io/en/docs/measurement

Les enregistrements DNS du domaine d’envoi

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Publish the DNS records of my Canopus sending domain.

1. Call get_sending_domain_status. It returns the records to publish (name, type, value), the transactional ones too when that stream is on.
2. If you can reach my DNS provider (its CLI or API in this environment), publish them exactly as given and touch no other record.
3. Otherwise, give me a table to copy: name, type, value.
4. If an SPF or DMARC record already exists on the same name, do not overwrite it: tell me, and show the merged value.

Call get_sending_domain_status again an hour later to tell me whether the domain is verified.

Les utilisateurs existants

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Bring my existing users into the Canopus CRM.

1. Find where users live in this codebase (database, auth provider) and count them. Do not run anything yet.
2. If the CRM webhook is wired (CRM_WEBHOOK_SECRET in the environment), write a one-off script that sends user.created for each existing user, signed like the integration, with a stable event_id per user so it can be run twice without duplicates, in small batches. Show it to me and run it only when I confirm.
3. If the webhook is not wired and there are fewer than fifty users, use upsert_contact for each, then search_contacts to check.
4. Never put the user list in this conversation.

Reference: https://www.canopushq.io/en/docs/crm

Les e-mails transactionnels

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Send my product's transactional emails (sign-up confirmation, password reset, receipts) through the Canopus email API.

1. Call get_sending_domain_status. The transactional stream must be verified; if it is not, stop and tell me to switch it on in Canopus, Settings, Sending domain.
2. The key is in the CANOPUS_API_KEY environment variable (scope transactional:send). If it is missing, stop and tell me to create one.
3. Replace the current sender behind one function, and keep the old provider behind a switch until I have checked a few real sends.
4. Change neither the content nor the recipients of any email.

Reference: https://www.canopushq.io/en/docs/email-api

Le sondage NPS

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Write the NPS survey Canopus sends my customers, in my customers' language.

1. Read the canopus://tone resource and the product in this repository.
2. The question itself is standard and cannot change. Write only the subject and the opening line, short and in my tone, and save them with save_survey_draft (kind nps).
3. Do not switch it on: I read it and switch it on in Canopus.

Le test A/B

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Prepare an A/B test on the headline of my landing page.

1. Read the landing page in this repository and the live site.
2. Propose two alternative headlines, each true to what the product does, nothing invented. Wait for me to pick one.
3. Create the draft with create_experiment_draft and the one I picked: a CSS selector that matches only the headline (an element whose content is plain text), and as goal the sign-up page or event.
4. Do not start it: I start it in Canopus.

Le suivi des erreurs

You are connected to the Canopus MCP server of my SaaS, and opened in its repository.
Answer me in French.
Work on a branch, build and test, and never push or deploy: tell me what to deploy.
Never write a secret in the code, a commit or this conversation: read it from the environment variable named below.

Send the errors of this product to Canopus, which replaces Sentry.

1. Call set_up_error_tracking. It returns the DSN (public by design: it can only add errors).
2. If this repository already uses a Sentry SDK, keep it: read the DSN from a new CANOPUS_DSN environment variable instead of the Sentry one, and set tracesSampleRate and replaysSessionSampleRate to 0 (Canopus keeps errors and logs, not traces or replays). Change nothing else.
3. If it does not, install the official Sentry SDK of this stack (for Next.js, @sentry/nextjs with its instrumentation files), init it with CANOPUS_DSN, enableLogs true, the two sample rates at 0, and sendDefaultPii false.
4. Set release to the commit sha the deployment exposes, so a problem says which deploy brought it.
5. If the build minifies JavaScript, add the source maps upload after the build: download https://www.canopushq.io/canopus-sourcemaps.mjs into the repository and run it with the release, reading the key from CANOPUS_API_KEY (scope sourcemaps:write, created in Canopus, Settings, API). It deletes the maps from the output.
6. Add a temporary route or script that throws a test error, run it locally with CANOPUS_DSN set, then call list_error_issues and check the error arrived. Remove the test code.
7. Tell me which environment variables to set in production, and what to deploy.
Reference: https://www.canopushq.io/en/docs/errors

Ce qui vous reste

  • Connecter Stripe, ajouter le domaine d’envoi, créer une clé ou un secret de webhook, le logo.
  • Chaque validation : une campagne, un post, une stratégie, un sondage activé, un test lancé, un budget publicitaire.
  • Le prompt du webhook CRM est sur la page du webhook dès que le secret existe : il porte vos propres champs du CRM.