Skip to content
This repository has been archived by the owner. It is now read-only.
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


This is the Ruby library which allows you to send notifications to your user's desktops using the Noti service.

Once a user has the application installed on their computer, you are able to send notifications straight to their desktop without any need for them to be running your web app.


Just add the gem to your Gemfile and follow the instructions on this page.

gem 'noti'


In order to communicate with the service, you will need to create your own Noti account and create an application. Once the application has been created you should set the application key as shown (replacing the key shown with the key you are provided with when you create your app): = '7f38ce2d-8d9a-25dd-e167-8f8a711b81f8'

Authenticating Users

Before you can send notifications to your users, they need to authorise your application. This is an easy process which is initiated from your application.

Step 1 - Creating a request token

To begin, you will need to create a request token. You can do this using the Noti.create_request_token command. This command accepts the URL to redirect to the to once they have authorised your application.

token = Noti::Token.create_request_token("")

You will receive back a Noti::Token instance which has responds to the following methods:

token.request_token   #=> '8494c9ed-6ca4-1af1-40ce-21954140d204'
token.redirect_url    #=> ''

You should store the request_token and redirect your user to the URL provided in the redirect_url. Once at this page the user will be prompted to enter their Noti credentials or create an account.

Step 2 - Obtaining an access token

Once the user has authorised and been returned to the redirect URL you provide, you should run the method below (passing the request token) to obtain an access token for this user. This token should be stored and used whenever you wish to send a notification to this user. This token will not expire unless the user revokes your application from being able to send them notifications.

access_token = Noti::Token.get_access_token('8494c9ed-6ca4-1af1-40ce-21954140d204')

The access_token variable will contain a string with the user's access token. Once you have the access token you no longer need the request token.

Sending a notification

In order to send a notification to a user, simply run the method shown below:

# Create a new notification object
notification =
notification.title = "An example notification"
notification.text = "Some further information about this notification"
notification.url = ""
notification.sound = "alert1"
notification.image = "example"

# Set the user to send the notification to and deliver it

# If you need to send the same notification to another user


A Ruby client library for using Noti






No releases published


No packages published