Skip to content

Commit e9474a6

Browse files
authored
Update README.md
1 parent 334b3c4 commit e9474a6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Read more about the [motivations and history](http://rauchg.com/slackin) behind
3636

3737
For other CloudFoundry providers, [follow these instructions.](https://github.com/pivotal-cf/slackin/wiki/Cloud-Foundry)
3838

39-
#### Custom
39+
#### NPM
4040

4141
Install it and launch it on your server:
4242

@@ -45,6 +45,18 @@ $ npm install -g slackin
4545
$ slackin "your-team-id" "your-slack-token"
4646
```
4747

48+
#### Node.js (programmatic use)
49+
50+
```
51+
const slackin = require('slackin').default;
52+
// slackin returns a `http.Server`
53+
// `server.app` is the underlying express app
54+
const server = slackin({
55+
/* options */
56+
});
57+
server.listen(3000);
58+
```
59+
4860
Your team id is what you use to access your login page on Slack (eg: https://**{this}**.slack.com).
4961

5062
You can find or generate your API test token at [api.slack.com/web](https://api.slack.com/web) – note that the user you use to generate the token must be an admin. You need to create a dedicated `@slackin-inviter` user (or similar), mark that user an admin, and use a test token from that dedicated admin user. Note that test tokens have actual permissions so you do not need to create an OAuth 2 app. Also check out the Slack docs on [generating a test token](https://get.slack.help/hc/en-us/articles/215770388-Creating-and-regenerating-API-tokens).

0 commit comments

Comments
 (0)