{"id":4223,"url":"https://github.com/xcarpentier/react-native-slack-webhook","last_synced_at":"2025-04-15T22:51:33.893Z","repository":{"id":57340147,"uuid":"60173213","full_name":"xcarpentier/react-native-slack-webhook","owner":"xcarpentier","description":"💬  Follow some activities (new user, payment, ...) from your app via Slack and this webhook lib","archived":false,"fork":false,"pushed_at":"2019-11-20T17:08:32.000Z","size":103,"stargazers_count":55,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T02:12:19.389Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xcarpentier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"xcarpentier","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-06-01T12:03:09.000Z","updated_at":"2023-04-25T14:37:36.000Z","dependencies_parsed_at":"2022-08-26T04:30:35.713Z","dependency_job_id":null,"html_url":"https://github.com/xcarpentier/react-native-slack-webhook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcarpentier%2Freact-native-slack-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcarpentier%2Freact-native-slack-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcarpentier%2Freact-native-slack-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcarpentier%2Freact-native-slack-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xcarpentier","download_url":"https://codeload.github.com/xcarpentier/react-native-slack-webhook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248524656,"owners_count":21118612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:04.989Z","updated_at":"2025-04-15T22:51:33.875Z","avatar_url":"https://github.com/xcarpentier.png","language":"Objective-C","funding_links":["https://github.com/sponsors/xcarpentier"],"categories":["Components","Objective-C","Others"],"sub_categories":["UI"],"readme":"[![NPM version](https://badge.fury.io/js/react-native-slack-webhook.svg)](http://badge.fury.io/js/react-native-slack-webhook)\n[![Downloads](https://img.shields.io/npm/dm/react-native-slack-webhook.svg)](https://www.npmjs.com/package/react-native-slack-webhook)\n\n# react-native-slack-webhook\n\nSlack webhook for React-Native\n\n![](http://i.imgur.com/oSd0Odt.gif)\n\n### Installation\n```bash\n$ npm i react-native-slack-webhook --save\n```\nor\n```bash\n$ yarn add react-native-slack-webhook\n```\n### Basic Usage\n- Install `react-native` first\n\n```bash\n$ npm i react-native -g\n```\n\n- Initialization of a react-native project\n\n```bash\n$ react-native init myproject\n```\n\n- Then, edit `myproject/index.ios.js`, like this:\n\n```jsx\n/**\n * @flow\n */\n\nimport React, { Component } from 'react';\nimport {\n  AppRegistry,\n  StyleSheet,\n  Text,\n  View,\n  TouchableOpacity\n} from 'react-native';\n\nimport Slack from 'react-native-slack-webhook';\nimport { webhookURL } from './env';\n\n\nclass example extends Component {\n  render() {\n\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cText style={styles.welcome}\u003e\n          Welcome to react-native-slack-webhook!\n        \u003c/Text\u003e\n        \u003cTouchableOpacity onPress={()=\u003e new Slack(webhookURL).post('Test', '#test')}\u003e\n          \u003cText style={styles.instructions}\u003e\n            Press it to send message\n          \u003c/Text\u003e\n        \u003c/TouchableOpacity\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: '#F5FCFF',\n  },\n  welcome: {\n    fontSize: 20,\n    textAlign: 'center',\n    margin: 10,\n  },\n  instructions: {\n    textAlign: 'center',\n    color: '#333333',\n    marginBottom: 5,\n  },\n});\n\nAppRegistry.registerComponent('example', () =\u003e example);\n```\n\n## Setup\n\n### Slack\n\nThis lib need a webhook url, details here : https://api.slack.com/incoming-webhooks.\n```JavaScript\nconst webhookURL = '\u003cyour webhook URL provided by Slack, ie. Incoming WebHooks\u003e'\nconst Slack = new Slack(webhookURL)\n```\n### Example\n\nJust provide a file name env.js at root of the example project, see the example/env.example.js file.\n\n## Payload object\n\n| Key | Type | Default | Description |\n| --- | --- | --- | --- |\n| channel | string | '#general' | The channel where you will post a message |\n| username | string | 'bot' | The username you will use to post the message  |\n| text | string | 'text is empty' | The most important part, the message you will send |\n| 'icon_emoji' | string | ':iphone:' | The icon emoji with your message |\n\n## FAQ\n### Is it supported and tested both on android and iOS?\nYES\n\n## Contribution\n\n- [@xcapentier](mailto:contact@xaviercarpentier.com) The main author.\n\n  PRs are welcome !\n\n## Questions\n\nFeel free to [contact me](mailto:contact@xaviercarpentier.com) or [create an issue](https://github.com/xcarpentier/react-native-slack-webhook/issues/new)\n\n\u003e made with ♥\n\n## Hire an expert!\nLooking for a ReactNative freelance expert with more than 12 years experience? Contact me from my [website](https://xaviercarpentier.com)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcarpentier%2Freact-native-slack-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxcarpentier%2Freact-native-slack-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcarpentier%2Freact-native-slack-webhook/lists"}