PHPackages                             level51/silverstripe-onesignal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. level51/silverstripe-onesignal

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

level51/silverstripe-onesignal
==============================

Silverstripe module wrapper for OneSignal PHP SDK

1.0.0(5y ago)0205MITPHP

Since Nov 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Level51/silverstripe-onesignal)[ Packagist](https://packagist.org/packages/level51/silverstripe-onesignal)[ RSS](/packages/level51-silverstripe-onesignal/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (3)Used By (0)

Silverstripe OneSignal
======================

[](#silverstripe-onesignal)

[![Build Status](https://camo.githubusercontent.com/4b1a6a8bed6b01db6c69721a3db84f55096deeda4eef3d031545e1a76e06bf40/68747470733a2f2f7472617669732d63692e636f6d2f4c6576656c35312f73696c7665727374726970652d6f6e657369676e616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Level51/silverstripe-onesignal)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/08c18a25a07bad85f6e33911d97868d27685150d91e32077349e208f86df99f9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c6576656c35312f73696c7665727374726970652d6f6e657369676e616c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Level51/silverstripe-onesignal/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/02b8a7b23a0aac77624c94da257595ed30dd99c39468f8127fe45ee00e5d4ca1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c6576656c35312f73696c7665727374726970652d6f6e657369676e616c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Level51/silverstripe-onesignal/?branch=master)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)

Silverstripe module wrapper for OneSignal PHP SDK.

Provides a class `OneSignalService` for creating/sending notifications. Use convenience classes `Notification` and `NotificationResponse` for handling request and response payload.

Requirements
------------

[](#requirements)

- Silverstripe ^4.0
- OneSignal PHP SDK `norkunas/onesignal-php-api`
- PSR-18 HTTP client (e.g. `symfony/http-client`)
- PSR-17 HTTP factories (e.g. `nyholm/psr7`)

Installation
------------

[](#installation)

```
composer require level51/silverstripe-onesignal

```

Documentation
-------------

[](#documentation)

The module is based on the [OneSignal API for PHP](https://github.com/norkunas/onesignal-php-api).

At the moment, only the Notifications API is being used.

This project adheres PSR-2.

### Config

[](#config)

Two env vars and one config value are mandatory when initializing `OneSignalService`. `OneSignalException` is thrown if not configured properly.

#### Environment

[](#environment)

Define the following vars in your `.env` file.

- `ONESIGNAL_AUTH_KEY` (defined on account/profile level)
- `ONESIGNAL_APP_AUTH_KEY`

Since the auth keys are sensitive data, it's recommended to not have them included in any VCS.

#### Config API

[](#config-api)

- `app_id`

Example:

```
Level51\OneSignal\OneSignalService:
  app_id: 'xxxxxx-0000-xxxx-0000-xxxxxxxxxx'
```

### Usage

[](#usage)

Send a simple notification.

```
try {
    $notification = Notification::create()
        ->addHeading('en', 'My first notification')
        ->addContent('en', 'Yay, my Silverstripe app created this')
        ->addData('myVar', 'foo');

    $response = OneSignalService::singleton()->createNotification($notification);
    if (!$response->isError()) {
        echo 'Notification with id ' . $response->getId() . ' was sent to ' . $response->getRecipientsCount() . ' recipients';
    }
} catch (OneSignalException $e) {}
```

Make sure to provide a [supported locale](https://documentation.onesignal.com/docs/language-localization#what-languages-are-supported) for `addHeading()` and `addContent()`.

Maintainer
----------

[](#maintainer)

- Julian Scheuchenzuber

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2015d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/441f0e8f95c17048417a33f37e35d5ffdd4c07902cbedaf7f5786f4b7c454284?d=identicon)[JZubero](/maintainers/JZubero)

---

Top Contributors

[![JZubero](https://avatars.githubusercontent.com/u/13751426?v=4)](https://github.com/JZubero "JZubero (38 commits)")

---

Tags

silverstripeonesignal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/level51-silverstripe-onesignal/health.svg)

```
[![Health](https://phpackages.com/badges/level51-silverstripe-onesignal/health.svg)](https://phpackages.com/packages/level51-silverstripe-onesignal)
```

###  Alternatives

[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[silverstripe/multi-domain

Allows multiple domains to access one CMS instance, mapping them to different sections of the hierarchy

141.6k](/packages/silverstripe-multi-domain)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
