Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions docs/deno-slack-sdk/guides/collaborating-with-teammates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
slug: /deno-slack-sdk/guides/collaborating-with-teammates
---

# Collaborating with teammates

<PaidPlanBanner />

Have multiple developers working on an app? Never fear! Teams can collaborate when building and deploying workflow apps.

## Deploy the app to make it available to collaborators {#deploy-to-collaborators}

Let's say you're working along on an app and you realize it's going to need several types of triggers. Your teammate Luke is the resident trigger expert, so you ask if he'll jump in and help you out, to which he enthusiastically agrees&mdash;hooray!

The first thing you'll do is to deploy your app using the `slack deploy` command.

✨ **For directions on how to deploy your app**, refer to [deploy to Slack](/deno-slack-sdk/guides/deploying-to-slack).

This will create an `apps.json` configuration file in your `.slack` folder (this folder may be hidden). This file contains information about your deployed apps, such as the installed workspace, the app name, the app ID, and the team ID. You'll want to check this file into version control in case you want to collaborate on the same deployed apps with others; if two or more people want to deploy or update the same app on the same workspace, the `apps.json` contents must be the same for everyone.

## Add collaborators {#collaborators}

Now, as long as Luke is in the same workspace as you, you can add Luke as a collaborator on your app right from the Slack CLI by entering the `slack collaborator add` command along with their email address or user ID. Choose your deployed environment, and voilà! Luke is now a collaborator on your app. To double-check, you can run the `slack collaborator list` command and choose your deployed environment&mdash;you should see yourself and Luke in the list.

In the meantime, Luke can clone the GitHub repository containing the files that comprise your app, including the `apps.json` file, to their local machine. If Luke also wants to deploy the app to the same workspace as you, they will have to run the `slack login` command within that workspace. Once logged in, Luke will have the same access to run the `slack deploy` command (and other Slack CLI commands) as you.

## Develop locally {#develop}

Both you and Luke can now develop locally on your unique instances of the app. Use the `slack run` command while working to see your changes in real-time within your local environment.

✨ **For information about developing locally**, refer to [local development](/deno-slack-sdk/guides/developing-locally).

### App instances {#app-instances}

Worthy of note is that there are now three instances of your app in existence:

* The deployed version of the app that exists within your shared workspace
* Your local version of the app
* Luke's local version of the app

:::info

Both your local projects will include an `apps.dev.json` file in your respective `.slack` folders, which are unique to your app and your local development environments. These files are only for local development and **should not** be checked into version control.

:::

## Deploy updates to production {#deploy-to-production}

Once you and Luke have completed development, either you or Luke can deploy the app to production by running the `slack deploy` command.

However, be aware that this could lead to a situation in which Luke makes a change and runs the `slack deploy` command--and at the same time, you make a different, unrelated change and run the `slack deploy` command. Since you're both deploying the same app, the second deploy will overwrite the first. It is therefore important to either automate or coordinate your deployments with care. Teamwork makes the dream work!
150 changes: 150 additions & 0 deletions docs/deno-slack-sdk/guides/creating-an-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
---
slug: /deno-slack-sdk/guides/creating-an-app
---

# Creating an app

<PaidPlanBanner />

An app goes through stages of development, from creation to experimentation and development to production. Sometimes a [removal](/deno-slack-sdk/guides/removing-an-app) happens too.

The [Slack CLI](/slack-cli) provides a set of commands to make managing these stages a bit easier with the following offerings:

- `slack create` to [create a brand new app](#create-app)
- `slack app link` to [link an existing app to a project](#link-app)

## Verify workspace authentication {#verify}

Before you can create (or remove) an app, ensure your CLI is authenticated into the workspace you want to develop in. You can do so with the `slack auth list` command:

```bash
$ slack auth list

myworkspace (Team ID: T123456789)
User ID: U123456789
Last update: 2022-03-24 18:20:47 -07:00
Authorization Level: Workspace

To change your active workspace authorization run slack login
```

## Create an app {#create-app}

With your CLI authenticated into the workspace you want to develop in, the next step is to scaffold an app with the `slack create` command:

```bash
$ slack create my-app
```
The above command will scaffold a new app called `my-app` in a directory with the same name. If you don't pass an app name, `slack` will scaffold an app with a random alphanumeric name.

You will be presented with three options to build from:
* The introductory [Issue Submission](https://github.com/slack-samples/deno-issue-submission) app
* The scaffolded [Deno Starter Template](https://github.com/slack-samples/deno-starter-template)
* The completely blank [Deno Blank Template](https://github.com/slack-samples/deno-blank-template)

:::tip
If you'd like to build from a specific sample app, see [Create an app from a template](#templates) below.
:::

```bash
? Select a template to build from: [Use arrows to move]

> Issue submission (default sample)
Basic app that demonstrates an issue submission workflow

Scaffolded project
Solid foundation that includes a Slack datastore

Blank project
A, well.. blank project

View more samples

Guided tutorials can be found at api.slack.com/automation/samples
```

Once you select an option the Slack CLI will get you set up for success.

```bash
$ slack create my-app

⚙️ Creating a new Slack app in ~/programming/my-app

📦 Installed project dependencies

✨ my-app successfully created

🧭 Explore the documentation to learn more
Read the README.md or peruse the docs over at api.slack.com/automation
Find available commands and usage info with `slack help`

📋 Follow the steps below to begin development
Change into your project directory with `cd my-app`
Develop locally and see changes in real-time with `slack run`
When you're ready to deploy for production use `slack deploy`
Create a trigger to invoke your workflows `slack trigger create`
```

After creating an app, don't forget to `cd` into your app project's directory.

➡️ **To keep building your own app**, learn about your app's manifest in the [manifest](/deno-slack-sdk/guides/using-the-app-manifest) section.

⤵️ **To use a sample app as a template instead**, read on!

### Create an app from a template {#templates}

:::warning[Evaluate third-party apps]

Exercise caution before trusting third-party and open source applications and automations (those outside of [`slack-samples`](https://github.com/slack-samples)). Review all source code created by third-parties before running `slack create` or `slack deploy`.

:::

We have a [collection of sample apps](https://github.com/slack-samples) containing a bevy of use cases. Find one particularly suited for your needs? Great! You can use it as a template to build from.

Create an app from a template by using the `create` command with the `--template` (or `-t`) flag and passing the link to the template's Github repo.

For example, the following command creates an app using our [Welcome Bot](https://github.com/slack-samples/deno-welcome-bot) app as a template:

```bash
slack create my-welcome-bot-app -t https://github.com/slack-samples/deno-welcome-bot
```

#### Create an app from a specific branch {#branch}

Use a specific branch of a template repo by using the `--branch` (or `-b`) flag and passing the name of a branch:

```bash
slack create my-welcome-bot-app -t https://github.com/slack-samples/deno-welcome-bot -b main
```

---

## Link an app {#link-app}

Apps that were created without the CLI can still be used with the CLI for ease in app management. This requires the `app link` command to save information about the app with the project it exists on:

```bash
slack app link --app A0123456789 --team T0123456789 --environment "deployed"
```

```bash
🏠 An existing app was added to the project
my-workspace:
App ID: A0123456789
Team ID: T0123456789
Status: Installed
```

This command can be used without flags, but the above example would use the app ID "A01234567890" from team "T01234567890" - the team the app was created on - as a "deployed" app. Following selections in commands will reveal this app as an option and it's all set for CLI use!

Another `--environment` option is "local" and this saves apps to `.slack/apps.dev.json`. Local apps are intended for personal development and experimentation while "deployed" apps - saved to `.slack/apps.json` - serve the needs of production.

Just one app ID can exist for each combination of team ID and environment to avoid accidental selections with duplicated possibilities. The provided app ID must also exist for this `link` command to complete with success.

---

## Onward

Your wish is our command! For information about other actions you can perform from the CLI, refer to the [Slack CLI commands guide](/slack-cli/guides/running-slack-cli-commands).

Check out more about how to configure your app via the [manifest](/deno-slack-sdk/guides/using-the-app-manifest). You can also start building [functions](/deno-slack-sdk/guides/creating-slack-functions) to perform some logic, chain them together in [workflows](/deno-slack-sdk/guides/creating-workflows), and create [triggers](/deno-slack-sdk/guides/using-triggers) to invoke those workflows.
Loading
Loading