https://github.com/willkessler/this-is-not-a-drill-basic-example
Extremely basic app for This Is Not A Drill! User Alerting service using plain typescript
https://github.com/willkessler/this-is-not-a-drill-basic-example
Last synced: about 1 year ago
JSON representation
Extremely basic app for This Is Not A Drill! User Alerting service using plain typescript
- Host: GitHub
- URL: https://github.com/willkessler/this-is-not-a-drill-basic-example
- Owner: willkessler
- License: mit
- Created: 2024-06-04T20:23:48.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-07T04:17:05.000Z (almost 2 years ago)
- Last Synced: 2024-06-07T23:56:01.409Z (almost 2 years ago)
- Language: TypeScript
- Size: 1.71 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Basic Example : This Is Not A Drill! User Alerting Service
**This is Not A Drill!** is a service with which you can popup
important service messages to grab your users' attention __in-app__.
Common use cases are :
* website outages / problems
* scheduled maintenance
* important updates to your user flow
* changes to your service offerings
* legal changes/updates, e.g. regarding privacy policy, SLA, or TOS
## What this demo is for
This demo shows how you can implement This Is Not A Drill! (`TINAD`) SDK in a `node` application.
1. Install the SDK via:
``` javascript
npm i @this-is-not-a-drill/vanillajs-sdk
or
yarn add @this-is-not-a-drill/vanillajs-sdk
```
2. Then, in your application, import and configure `TINAD`:
``` javascript
import {
configureTinad,
generateDefaultConfiguration,
getCurrentConfiguration,
SDKConfiguration
} from '@this-is-not-a-drill/vanillajs-sdk';
// Generate some sensible default TINAD configuration values.
const newConfig = generateDefaultConfiguration();
// See 'environment.ts' in this directory.
newConfig.api.endpoint = environment.API_ENDPOINT;
// see 'environment.ts' in this directory.
newConfig.api.key = environment.API_KEY;
// Set this to whatever notification display mode you prefer:
// toast, modal, banner, inline.
newConfig.api.displayMode = 'toast';
// Lastly, tell TINAD to start (or restart) with your configuration.
configureTinad(newConfig);
```
After this, you can always call `configureTinad({})` to make `TINAD` operate in a new way (e.g. inline
notifications on certain pages).
You can read more in our documentation.
Looking for a tighter integration with React? Take a look at our React SDK.
