Skip to content

About

Motoko and Rust libraries for sending Internet Identity notifications from a canister.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

86 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

identity-notifications

Notify Internet Identity users from your canister. One call to send; the library handles the ids, the batching, the retries, the content Internet Identity pulls back, and the delivery metrics.

Motoko:

notifications.send<system>(
  recipient,
  {
    title = "New message";
    body = text;
    url = ?("https://chat.example.com/chats/" # caller.toText());
    key = ?("chat-" # caller.toText());
    urgency = null;
    expiresAt = null;
    funnel = null;
  },
);

Rust:

notifications::send(
    recipient,
    Notification {
        title: "New message".into(),
        body: text,
        url: Some(format!("https://chat.example.com/chats/{from}")),
        key: Some(format!("chat-{from}")),
        ..Default::default()
    },
);
  • motoko/ — the Mops package, for a Motoko canister.
  • rust/ — the crate, for a Rust canister.

Same surface, same behaviour. See Releasing.md for how each is released.

About

Motoko and Rust libraries for sending Internet Identity notifications from a canister.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages