MCPInstall

extension-email-verification

Support for sending an email with a link the recipient can click to prove they own the email address.

Installs
28.3K
Last 24h
+186
Trending rank
#1268
Security
Pass

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/caffeinelabs/skills --skill extension-email-verification
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads extension-email-verification automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

Security audits

Independent scans of the skill's instructions and bundled files.

Gen Agent Trust Hub PassSAFE ·This skill implements a standard email verification workflow for the Caffeine AI platform. It utilizes official backend and frontend libraries to manage single-use tokens and verification status. No malicious patterns or security risks were identified.
Socket PassNo alerts
Snyk PassLOW ·Risk: LOW · No issues
ZeroLeaks PassNONE ·Score: 93/100 · 2 sections analyzed

SKILL.md

The instructions your agent reads when the skill is triggered.

Email — Verification

Email verification extension for Caffeine AI.

Overview

This skill adds email address verification via a click-to-verify link that lands on the app's own frontend. The backend mints and stores the link token (verificationTokens) and confirms it through MixinEmailVerification; verifiedEmails tracks verified addresses. The frontend renders the /verify-email page, where the recipient clicks a button to confirm.

Required Setup Checklist

All five steps are mandatory.

  1. mops dependencies — mops add caffeineai-email-verification and mops add caffeineai-email.
  2. Two stable state fields — verifiedEmails : VerifiedEmails.State and verificationTokens : VerificationTokens.State, initialised in the migration chain head with VerifiedEmails.new() and VerificationTokens.new().
  3. Mixin invocation — include MixinEmailVerification(verifiedEmails, verificationTokens) in main.mo.
  4. Sending — EmailVerification.sendVerificationEmail(verificationTokens, fromUsername, recipients, subject, htmlBody); the body MUST contain {{VERIFICATION_URL}}.
  5. Frontend npm package and route — @caffeineai/email-verification installed, and a public route /verify-email (reachable without signing in) that renders a button calling confirm().

CRITICAL: the link in the email is https://<app domain>/verify-email?token=…. Without the frontend route the recipient lands on a missing page and the address is never verified.

Backend

This component is for sending an email to users with a verification link which the user can click to prove they own the email address.

To check if an email address has been verified

Use the prefabricated module mo:caffeineai-email-verification/verifiedEmails.mo which cannot be modified.

module {
  public type State = {
    verifiedEmails : Set.Set<Text>;
  };

  public func new() : State;

  public func contains(state : State, email : Text) : Bool;

  public func iter(state : State) : Iter.Iter<Text>;

  public func size(state : State) : Nat;
};

To check whether an email is verified use the contains function. Do NOT try to track the email verification status independently by storing it against the user profile.

Pending verification links

Use the prefabricated module mo:caffeineai-email-verification/verificationTokens.mo which cannot be modified. It holds the tokens of links sent but not yet clicked; a token is single use and expires after 24 hours. The app only declares the state and passes it around.

module {
  public type State = {
    tokens : Map.Map<Text, { email : Text; createdAt : Time.Time }>;
  };

  public func new() : State;

  public func size(state : State) : Nat;
};

To handle the verification link

Use the prefabricated module mo:caffeineai-email-verification/verificationMixin.mo which cannot be modified.

MixinEmailVerification takes both states. It adds _caffeineEmailConfirmVerification(token), which the app's frontend calls from the verification page: it marks the address the token was sent to as verified and returns it. Anyone holding a valid token can call it, the anonymous principal included, so the recipient needs no account.

import MixinEmailVerification "mo:caffeineai-email-verification/verificationMixin";

mixin (verifiedEmails : VerifiedEmails.State, verificationTokens : VerificationTokens.State) {
  public shared func _caffeineEmailConfirmVerification(token : Text) : async { #ok : Text; #err : Text };
};

For sending users a verification email

  • Use the sendVerificationEmail function of the prefabricated module mo:caffeineai-email-verification/verification.mo which cannot be modified. Do NOT call EmailClient.broadcast from app code: this module prepares the tokens and the link template it sends.
  • It returns a SendResult which is #ok if the email is sent successfully otherwise #err(error) with the error text.
  • Each recipient receives an individual email with a specific verification link for them, pointing at the app's /verify-email page.
  • The htmlBody MUST contain the placeholder text {{VERIFICATION_URL}}; the function returns #err when it is missing.
  • The mail goes through the mail gateway with the settings the platform injects on every deploy (INTEGRATIONS_GATEWAY_URL / INTEGRATIONS_GATEWAY_API_KEY); without them the function returns #err.
module {
  public func sendVerificationEmail(
    tokens : VerificationTokens.State,
    fromUsername : Text,
    recipients : [Text],
    subject : Text,
    htmlBody : Text,
  ) : async { #ok; #err : Text };
};

Example usage with endpoints for registering a user and for checking whether a user is verified.

import Map "mo:core/Map";
import Runtime "mo:core/Runtime";
import Principal "mo:core/Principal";
import Text "mo:core/Text";
import EmailVerification "mo:caffeineai-email-verification/verification";
import MixinEmailVerification "mo:caffeineai-email-verification/verificationMixin";
import VerificationTokens "mo:caffeineai-email-verification/verificationTokens";
import VerifiedEmails "mo:caffeineai-email-verification/verifiedEmails";

actor {
  // Stores which emails are verified
  let verifiedEmails : VerifiedEmails.State;

  // Pending verification links, until clicked or expired
  let verificationTokens : VerificationTokens.State;

  // User profiles storage
  let users : Map.Map<Principal, User>;

  // Email to principal mapping for uniqueness check
  let emailToPrincipal : Map.Map<Text, Principal>;

  // Handles the verification link and updates the verifiedEmails store
  include MixinEmailVerification(verifiedEmails, verificationTokens);

  type User = {
    name : Text;
    email : Text;
  };

  public shared ({ caller }) func registerUser(email : Text, name : Text) : async () {
    if (users.containsKey(caller)) {
      Runtime.trap("User already registered");
    };
    if (emailToPrincipal.containsKey(email)) {
      Runtime.trap("Email already registered");
    };

    let user : User = {
      name;
      email;
    };
    users.add(caller, user);
    emailToPrincipal.add(email, caller);
    let result = await EmailVerification.sendVerificationEmail(
      verificationTokens,
      "no-reply",
      [email],
      "Welcome to Our Service",
      "Hello " # name # ",<br><br>Thank you for registering with our service. Please <a href=\"{{VERIFICATION_URL}}\">click here</a> to verify your email address<br><br>Best regards,<br>The Team",
    );

    switch (result) {
      case (#ok) {};
      case (#err(error)) {
        Runtime.trap("Couldn't send verification email: " # error);
      };
    };
  };

  public shared ({ caller }) func isEmailVerified() : async Bool {
    let user = users.get(caller) ?? Runtime.trap("User not registered");
    VerifiedEmails.contains(verifiedEmails, user.email);
  };
};

The migration chain head:

import Map "mo:core/Map";
import VerificationTokens "mo:caffeineai-email-verification/verificationTokens";
import VerifiedEmails "mo:caffeineai-email-verification/verifiedEmails";

module {
  type User = {
    name : Text;
    email : Text;
  };

  type NewActor = {
    verifiedEmails : VerifiedEmails.State;
    verificationTokens : VerificationTokens.State;
    users : Map.Map<Principal, User>;
    emailToPrincipal : Map.Map<Text, Principal>;
  };

  public func migration(_old : {}) : NewActor {
    {
      verifiedEmails = VerifiedEmails.new();
      verificationTokens = VerificationTokens.new();
      users = Map.empty<Principal, User>();
      emailToPrincipal = Map.empty<Text, Principal>();
    };
  };
};

Upgrading from the previous version

An app built with caffeineai-email-verification 0.2.x re-pins with mops add caffeineai-email-verification@0.3.0 and mops add caffeineai-email@0.4.0, and bumps @caffeineai/email-verification to 0.3.0. Nothing in the app code changes. The mixin no longer has the _caffeineEmailVerify callback of the transport canister: verification mail now always goes through the mail gateway, and the links in mail the transport sent before 0.2.0 stop working.

An app built with caffeineai-email-verification 0.1.x and caffeineai-email 0.2.x needs all of these, then the re-pin above:

  1. Re-pin: mops add caffeineai-email-verification@0.2.0 and mops add caffeineai-email@0.3.0.
  2. Declare the new stable field verificationTokens : VerificationTokens.State and add it to the migration chain (a new migration file initialising it with VerificationTokens.new(); verifiedEmails keeps its shape and its data).
  3. Change include MixinEmailVerification(verifiedEmails) to include MixinEmailVerification(verifiedEmails, verificationTokens).
  4. Replace EmailClient.sendVerificationEmail(fromUsername, recipients, subject, htmlBody) with EmailVerification.sendVerificationEmail(verificationTokens, fromUsername, recipients, subject, htmlBody) (import mo:caffeineai-email-verification/verification).
  5. Add the frontend package and the /verify-email route described below.

Frontend

Install @caffeineai/email-verification. It exports the prefabricated hook useEmailVerification, which cannot be modified:

export interface EmailVerificationActor {
  _caffeineEmailConfirmVerification(token: string): Promise<{ ok: string } | { err: string }>;
}

// ready: a token is in the URL and nothing was sent yet
// pending: the backend call is in flight
// done: the address is verified; `email` holds it
// invalid: the URL has no token, or the backend rejected it
// error: the backend call failed; `error` holds the message
export type EmailVerificationStatus = 'ready' | 'pending' | 'done' | 'invalid' | 'error';

export declare function useEmailVerification(actor: EmailVerificationActor | null | undefined): {
  status: EmailVerificationStatus;
  email: string | null;
  error: string | null;
  hasToken: boolean;
  // True once the actor is available, a token is present and nothing was sent yet
  isReady: boolean;
  // Confirms the address through the backend. Call it from a button click only.
  confirm: () => Promise<void>;
};

Rules for the verification page:

  • Add a route at /verify-email that is reachable WITHOUT signing in: recipients open it from their mail client and have no session. The backend method takes the token as its only credential, so the anonymous actor from useActor is enough.
  • Read the token with the hook (it takes ?token= from the URL itself) and render a button that calls confirm(). NEVER call confirm() on page load or in an effect: mail clients, link previewers and scanners fetch the URL without a person behind it, and a fetch must verify nothing.
  • Show the outcome from status: done with the verified email, invalid for a missing, used or expired link (offer to request a new email), error with the message.

Example page:

import { useEmailVerification } from '@caffeineai/email-verification';
import { useActor } from '@caffeineai/core-infrastructure';
import { createActor } from '@/backend';

export function VerifyEmailPage() {
  const { actor } = useActor(createActor);
  const { status, email, error, isReady, confirm } = useEmailVerification(actor);

  if (status === 'done') return <p>{email} is verified. You can close this page.</p>;
  if (status === 'invalid') return <p>{error ?? 'This verification link is invalid or has expired.'}</p>;
  if (status === 'error') return <p>Something went wrong: {error}</p>;

  return (
    <button onClick={() => void confirm()} disabled={!isReady}>
      {status === 'pending' ? 'Verifying…' : 'Verify my email address'}
    </button>
  );
}

Register it with the app's TanStack Router alongside the other routes, as a child of the root route with path: '/verify-email', outside any authenticated layout.

If there is a UI for the admin to enter the content of a verification email then indicate that the placeholder text {{VERIFICATION_URL}} must be present in the email body.

FAQ

What does the extension-email-verification skill do?

Support for sending an email with a link the recipient can click to prove they own the email address.

How do I install extension-email-verification?

Run npx skills add https://github.com/caffeinelabs/skills --skill extension-email-verification in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/extension-email-verification/ (personal) or .claude/skills/extension-email-verification/ (project).

Which AI agents can use extension-email-verification?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is extension-email-verification safe to install?

Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed; ZeroLeaks passed. As with any skill, read the SKILL.md and bundled scripts before installing.

Who maintains extension-email-verification?

It is published by caffeinelabs in caffeinelabs/skills. It has 28,311 recorded installs.

More from caffeinelabs/skills

View all →

Support for organising events/meetings and sending invitations by email.

extension-stripe

caffeinelabs/skills

Payment support based on Stripe, supporting credit cards and debit cards. Checkout and session status use HTTP outcalls. For inbound Stripe webhooks (POST to the canister), also load extension-http-endpoints.

Backend & APIs28.4K installs

extension-qr-code

caffeinelabs/skills

QR code scanner using the camera.

28.4K installs

extension-camera

caffeinelabs/skills

Web-camera support.

28.3K installs

extension-email-marketing

caffeinelabs/skills

Send personalised marketing emails to subscribers with an unsubscribe link.

Marketing & SEO28.3K installs

extension-authorization

caffeinelabs/skills

Authorization system with role-based access control. Must-have for all apps that manage personal or access-restricted data.

28.3K installs

Popular productivity & automation skills

View category →

agent-browser

vercel-labs/agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

OfficialProductivity & Automation1.3M installs

lark-doc

open.feishu.cn

飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。

lark-base

open.feishu.cn

飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。

lark-drive

open.feishu.cn

飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。

lark-shared

open.feishu.cn

Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.

lark-im

open.feishu.cn

飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。