https://github.com/doowb/slack-invite-webtask
Webtask.io service to invite users to a slack team.
https://github.com/doowb/slack-invite-webtask
Last synced: over 1 year ago
JSON representation
Webtask.io service to invite users to a slack team.
- Host: GitHub
- URL: https://github.com/doowb/slack-invite-webtask
- Owner: doowb
- License: mit
- Created: 2016-08-29T16:31:14.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-29T19:30:38.000Z (almost 10 years ago)
- Last Synced: 2025-02-26T19:51:48.558Z (over 1 year ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# slack-invite-webtask [](https://www.npmjs.com/package/slack-invite-webtask) [](https://npmjs.org/package/slack-invite-webtask) [](https://travis-ci.org/doowb/slack-invite-webtask)
Webtask.io service to invite users to a slack team.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save slack-invite-webtask
```
## Usage
```js
var invite = require('slack-invite-webtask');
module.exports = function(ctx, req, res) {
// do any customization for your implementation here
invite(ctx, req, res);
};
```
## What is this?
This module is intended to be used in a [webtask.io](https://webtask.io/) task to provide slack invitation functionality.
There is a distribution file provided in [dist/main.js](dist/main.js) if you want to deploy it to webtask.io directly using the following command:
```bash
$ wt create node_modules/slack-invite-webtask/dist/main.js --name my-slack-invite-name --secret SLACK_TEAM='my-slack-team' --secret SLACK_TOKEN='XXXXXXX'
```
The main requirement is to provide the `SLACK_TEAM` and `SLACK_TOKEN` values. The above example shows setting them as secrets so they'll be available on the `ctx` when the webtask is executed.
The `SLACK_TEAM` property is the same as the subdomain used when accessing slack... `https://{slack-team}.slack.com`.
The `SLACK_TOKEN` property is the authentication token of an administrator for the specified slack team that can invite people to slack.
## Webtask usage
After the webtask has been created, it can be used by `POST`ing to the webtask url and providing an `email` property in the body.
```html
Email
```
A JSON object will be returned. If an error occurs, the JSON object will contain an `error` property with the corresponding error message. Otherwise, the success message from slack will be returned.
## About
### Related projects
[gulp-bundle-webtask](https://www.npmjs.com/package/gulp-bundle-webtask): Gulp plugin for browserifying and bundling your source code before deploying to webtask.io. | [homepage](https://github.com/doowb/gulp-bundle-webtask "Gulp plugin for browserifying and bundling your source code before deploying to webtask.io.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
Please read the [contributing guide](contributing.md) for avice on opening issues, pull requests, and coding standards.
### Building docs
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
```sh
$ npm install -g verb verb-generate-readme && verb
```
### Running tests
Install dev dependencies:
```sh
$ npm install -d && npm test
```
### Author
**Brian Woodward**
* [github/doowb](https://github.com/doowb)
* [twitter/doowb](http://twitter.com/doowb)
### License
Copyright © 2016, [Brian Woodward](https://github.com/doowb).
Released under the [MIT license](https://github.com/doowb/slack-invite-webtask/blob/master/LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on August 29, 2016._