Announcing the Ably VS Code Extension
Tags: vscode, programming, tooling, webdev
Published: 2022-05-09 11:29:21

We're excited to announce the Ably VS Code extension! With this extension you can manage your Ably applications directly from VS Code.

This blog post covers:

- What is VS Code?
- Installing the extension.
- The extensions capabilities.
- How to contribute.

> **TL;DR** Install the Ably VS Code extension via the [Marketplace](https://marketplace.visualstudio.com/items?itemName=ably-labs.vscode-ably).

## What is VS Code?

[Visual Studio Code (VS Code)](https://code.visualstudio.com/) is a free code editor, built on open source, which runs on macOS, Windows, and Linux. In the Stack Overflow [developer survey of 2021](https://insights.stackoverflow.com/survey/2021#section-most-popular-technologies-integrated-development-environment), VS Code was ranked the most popular code editor (71% out of 82k responses).

At Ably, we are big fans of VS Code. We like the clean interface, the command palette, the level of customization and, most importantly, the extensibility.

There are thousands of extensions available in the [VS Code Marketplace](https://marketplace.visualstudio.com/VSCode), ranging from code formatters to unit test code runners, and interfaces with 3rd party services.

## The Ably VS Code extension

The new [Ably VS Code extension](https://marketplace.visualstudio.com/items?itemName=ably-labs.vscode-ably) allows you to create and inspect your Ably applications without leaving VS Code, meaning you don't have to context-switch to use the browser.

The development of the Ably VS Code extension started during the internal [Ably Innovation Days](https://twitter.com/marcduiker/status/1498959259085717508) a couple of weeks ago. Within two days our team had a working prototype of the VS Code extension. The extension won the *Ship It!* category for being most actionable. A few additional days were spent on development, to make it look good and improve the user experience.

{% embed https://twitter.com/marcduiker/status/1498959259085717508 %}

### Installing the extension

You can install the extension either via the [Marketplace](https://marketplace.visualstudio.com/items?itemName=ably-labs.vscode-ably) or via the extensions activity bar in VS Code.

![Install Ably via VS Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91qk46xo7svkm6kd3n5p.gif)

Once installed, the extension requires a couple of settings to be configured.

1. Your [Ably Account ID](https://ably.com/docs/control-api#account-id).
2. A [Control API Access token](https://ably.com/docs/control-api#creating-access-token) with the following capabilities:
   - read:app
   - write:app
   - read:key
   - write:key
   - read:queue
   - write:queue
   - read:rule
   - write:rule

![Ably extension settings in VS Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9zqwebrwmy4rql5x5yf.gif)

*Administrative access to the Ably account is required.*

### Extension features

Let's have a look at the features the Ably VS Code extension offers. We'll cover:

- The App Explorer.
- Copying API keys.
- Refreshing the App Explorer.
- Creating new apps.

#### Ably App Explorer

The Ably App Explorer is accessed via the Ably logo in the activity bar, or using the command palette, `CTRL+SHIFT+P`, and type `Ably App Explorer`.

All the Ably apps are listed in the explorer, sorted alphabetically. Each app can be expanded to show the API keys, queues, and integration rules, and inspect their respective details like key capabilities, individual queues, and rule conditions.

![Ably App Explorer in VS Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/532wef8lt68d070ke3kb.gif)

#### Copy API Keys

When you quickly need to copy an API key for an Ably app, expand the app and API Keys node in the explorer and click the `Copy to Clipboard` icon next to the key name.

![Copying an API key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8ycqq1gc6icuubq6roa.png)

#### Refresh the App Explorer

The App Explorer is refreshed manually by clicking the three dots in the App Explorer menu and selecting *Refresh*. This is useful when someone creates an Ably app in the Ably Dashboard and the App Explorer needs to be in sync with the latest changes.

![Refresh the App Explore](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mvu2wxir1ptvsgvk5w5e.png)

#### Creating a new Ably app

The extension is also capable of creating new Ably apps via the *Create App* command in the Command Palette. Hit `CTRL+SHIFT+P` and type `Ably: Create App`.

![Create App via Command Palette](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdvw548vlj0fecxrqqvt.gif)

Alternatively, the *Create App* command is started by clicking the three dots in the App Explorer menu, and selecting *Create App*.

![Create App via App Explorer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjs40pu8dy3ebqhujg1c.png)

## Feedback and contributing

Now that you know how to use the extension to inspect and create Ably apps, we'd love to get your feedback on it. Please try it out, and let us know what you think. It is in preview at the moment, so some things might not be working as expected. You can share your experiences with us on our [Ably Discord](https://discord.gg/q89gDHZcBK).

In case you find a bug, please submit an issue on GitHub using the [Issue template](https://github.com/ably-labs/vscode-ably/issues/new?assignees=&labels=issue+%F0%9F%AA%B2&template=ISSUE.yml&title=Issue%3A+%3CTITLE%3E). If you have a feature request then please use the [Feature template](https://github.com/ably-labs/vscode-ably/issues/new?assignees=&labels=feature+%F0%9F%9A%80&template=FEATURE.yml&title=Feature%3A+%3CTITLE%3E).

If you're interested, you can also contribute to this extension, have a look at the  contribution guide in the [GitHub repo](https://github.com/ably-labs/vscode-ably).

## Further reading

- [Infrastructure as Code: Manage apps using the Ably Control API GitHub Action](https://dev.to/ably/infrastructure-as-code-manage-apps-using-the-ably-control-api-github-action-218i)
- [Introducing Control API: provision and configure Ably programmatically](https://ably.com/blog/introducing-control-api-provision-configure-ably-programmatically)