# Chime v0.1.0-dev - API Reference

## Modules

- Notifications
  - [Chime](Chime.md): Chime is notifications for Phoenix: something happens in the app, and
Chime tells the people it concerns, in the app's feed (the bell), by
email and by the app's own channels, as each person wants.
  - [Chime.Config](Chime.Config.md): The options of Chime, given to its child in the app's supervision tree,
after the repo, the PubSub and Oban
  - [Chime.Event](Chime.Event.md): Something that happened, once, whoever it notifies: a call of
`Chime.notify/3`. Its notifications point to it.
  - [Chime.Explain](Chime.Explain.md): Why a person got a notification, or did not: the log of what Chime
decided, with the reason of each decision.
  - [Chime.Feed](Chime.Feed.md): A person's feed: their notifications, the newest first, and what they
did with them. `Chime` has the functions; the JSON API and `Chime.Live`
are over them.
  - [Chime.Messages](Chime.Messages.md): Chime's words, in the app's languages, by the app's own Gettext. Chime
ships English, and a template of its words; the app translates them as
it translates its own.
  - [Chime.Notification](Chime.Notification.md): What a person was told of an event: an item of their feed, and what the
other channels' deliveries hang from.
  - [Chime.Notifier](Chime.Notifier.md): A kind of notification of the app: who it goes to, by which channels,
and what it says in each. Chime has none of its own; the app writes one
module for each kind it has.
  - [Chime.Preferences](Chime.Preferences.md): What each person wants to hear about: a setting for each category of
`Chime.Config` and each channel.
  - [Chime.Recipient](Chime.Recipient.md): A person who gets notifications, as the app's `Chime.Resolver` says
  - [Chime.Resolver](Chime.Resolver.md): How Chime knows the people of the app. The app writes one module, from
the users it already has, and gives it to Chime's config

- Channels
  - [Chime.Channel](Chime.Channel.md): A way to tell a person, besides the feed and email: Telegram, SMS,
Slack, Discord, the app's own push. The app writes a module and names
it in the config's `:channels`
  - [Chime.Channels.Discord](Chime.Channels.Discord.md): Discord: a message by a channel's webhook.
  - [Chime.Channels.Email](Chime.Channels.Email.md): The `:email` channel: the notifier's `c:Chime.Notifier.email/3`, sent
with the app's mailer (`:mailer` in `Chime.Config`).
  - [Chime.Channels.Push](Chime.Channels.Push.md): The `:push` channel: a notification on a person's devices, browsers by
Web Push, Apple's by APNs, Android's by FCM, with the services of the
config's `:push` (see the [Push](push.md) guide).
  - [Chime.Channels.Slack](Chime.Channels.Slack.md): Slack: a message to a person, or to a channel of the team's.
  - [Chime.Channels.Teams](Chime.Channels.Teams.md): Microsoft Teams: an Adaptive Card by a channel's workflow webhook (or
an incoming webhook).
  - [Chime.Channels.Twilio](Chime.Channels.Twilio.md): SMS by Twilio: a text to the person's phone.
  - [Chime.Channels.Webhook](Chime.Channels.Webhook.md): A webhook: the notification as JSON, signed, posted to an address of
the app's or the person's.
  - [Chime.Delivery](Chime.Delivery.md): A notification by a channel other than the feed, and what became of it:
the log `Chime.Explain` reads.
  - [Chime.Device](Chime.Device.md): A person's device, for the `:push` channel
  - [Chime.Digest](Chime.Digest.md): The digests: one email of the notifications of a day or a week, for the
people who chose `"daily"` or `"weekly"` for a category's email
(`Chime.Preferences`).
  - [Chime.Message](Chime.Message.md): A notification on its way to a person by a channel, as
`c:Chime.Channel.deliver/2` gets it

- In the app
  - [Chime.Components](Chime.Components.md): The bell, the feed and the preferences in the app's LiveViews, from
`@chime` (`Chime.Live`)
  - [Chime.Live](Chime.Live.md): The feed in the app's LiveViews: an `on_mount` hook that gives each
LiveView of a `live_session` the `@chime` assign, for the components of
`Chime.Components`.
  - [Chime.Live.State](Chime.Live.State.md): The `@chime` assign

- Mounting
  - [Chime.API](Chime.API.md): The feed and the preferences as JSON, for a frontend that Phoenix does
not render: React, Vue, Svelte, a mobile app. Mounted with
`Chime.Router.chime_api/2`
  - [Chime.Admin.Access](Chime.Admin.Access.md): Who may see Chime's admin (`Chime.Router.Admin`): the app writes one
module, from its own admins.
  - [Chime.Links](Chime.Links.md): Links that open a notification from an email or a channel, and read it
in the feed: the same notification is read everywhere.
  - [Chime.Router](Chime.Router.md): Mounts Chime in the app's router.
  - [Chime.Router.Admin](Chime.Router.Admin.md): The admin, mounted with `chime_admin/2` (imported with `Chime.Router`):
a person's notifications and their log, the events, the deliveries
that failed and a way to send them again.
  - [Chime.Router.Mail](Chime.Router.Mail.md): The addresses of the emails' links, mounted with `chime_mail/2`
(imported with `Chime.Router`) at the config's `:mail_url`: to
unsubscribe (`Chime.Unsubscribe`), and to open a notification, which
reads it (`Chime.Links`).

  - [Chime.Token](Chime.Token.md): Signed tokens of a person, for the JSON API (`Chime.API`) where the
app's own session or token does not reach: an `EventSource` cannot send
an `authorization` header, and a page on another origin has no cookie
of the app's.
  - [Chime.Unsubscribe](Chime.Unsubscribe.md): The links to unsubscribe of the emails, mounted with
`Chime.Router.chime_mail/2` at the config's `:mail_url`

- Database
  - [Chime.Migrations](Chime.Migrations.md): The tables of Chime, in a migration of the app.

- Testing
  - [Chime.Test](Chime.Test.md): Helpers for the app's tests of its notifications, with no Oban to run
and no clock to wait for.

## Mix Tasks

- [mix chime.gen.migration](Mix.Tasks.Chime.Gen.Migration.md): Generates the migration of Chime's tables in the app's repo: the one
that installs them, or, after an upgrade of Chime, the one that brings
them to its latest version.
- [mix chime.gen.vapid](Mix.Tasks.Chime.Gen.Vapid.md): Generates a pair of VAPID keys, for `:web` of the `:push` option of
`Chime.Config`

