https://github.com/bendrucker/sms-link
Generate an SMS protocol link
https://github.com/bendrucker/sms-link
Last synced: about 1 year ago
JSON representation
Generate an SMS protocol link
- Host: GitHub
- URL: https://github.com/bendrucker/sms-link
- Owner: bendrucker
- License: mit
- Created: 2015-09-08T02:01:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T04:10:33.000Z (about 6 years ago)
- Last Synced: 2025-06-11T10:04:21.566Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 22
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# sms-link [](https://travis-ci.org/bendrucker/sms-link) [](https://greenkeeper.io/)
> Generate an SMS protocol link
## Install
```
$ npm install --save sms-link
```
## Usage
```js
var smsLink = require('sms-link')
smsLink({phone: '411', body: 'Hello world'})
// On iOS 8
//=> sms:411&body=Hello%20world
```
Tested operating systems:
* iOS 8
* iOS 9
* Android 5
If you test a new device version please send a [pull request](https://github.com/bendrucker/sms-link/pulls) adding it to this list.
## API
#### `smsLink(options)` -> `string`
Returns a URL string.
##### options
*Required*
Type: `object`
Either `phone` or `body` is required.
###### phone
Type: `string`
The phone number to prefill in the new SMS.
###### body
Type: `string`
The body to prefill in the new SMS. Text will be url-encoded in the returned URL.
## License
MIT © [Ben Drucker](http://bendrucker.me)