soxtoby / SlackNet

A comprehensive Slack API client for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Socket mode confusing on demo apps

VictorioBerra opened this issue · comments

  • Examples/AspNetCore does not use sockets, and theres a comment that says "// You can enable socket mode for testing without having to make your web app publicly accessible"
  • Examples/SlackNetDemo uses sockets.

Which should I use?

Should I not use sockets with ASPNET Core? Why would I only want to use sockets for testing?

Thanks for the question, @VictorioBerra. I'd say the main thing to be aware of here is that socket mode apps cannot be published to the public Slack App Directory; instead you need to host a public HTTP endpoint to receive events from Slack.

If you're using ASP.NET to create a public app, socket mode can make development easier, because you can test your changes on a private socket mode version of your app without needing to expose your local webserver publicly. When the app is released publicly you would need to disable socket mode.

If you're creating a private app for your own workspace, then you can just stick with socket mode. ASP.NET isn't required for interacting with Slack in this scenario, and there's not much point in using it unless you're already using it for some other reason (e.g. the Slack app is part of an existing internal website, or you want to host content that gets linked to from Slack).

The Slack developer documentation has more information on the different ways you can connect to Slack, but hopefully I've cleared things up somewhat.

Thank you this helps. Also I was able to test locally with events using localtunnel but I agree sockets are simpler.

Tory