slackdesktop

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package slackdesktop reads the Slack desktop application's on-disk state: the session `d` cookie (from the app's encrypted Cookies sqlite DB) and the list of signed-in workspaces (from storage/root-state.json).

The cookie-decryption logic is adapted from github.com/rneatherway/slack (MIT License, Copyright (c) rneatherway). Original notice retained.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDesktopNotFound = errors.New("slack desktop app config directory not found")
	ErrNotSignedIn     = errors.New("no slack workspaces are signed in")
	ErrCookieDBMissing = errors.New("slack cookie database not found")
	ErrKeyringLocked   = errors.New("system keyring is locked")
	ErrNoSecretService = errors.New("no system secret service available")
	ErrDecryptFailed   = errors.New("failed to decrypt slack session cookie")
)

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the Slack desktop config dir, or ErrDesktopNotFound if it does not exist on disk.

func Cookie() (string, error)

Cookie reads and decrypts the Slack desktop `d` cookie.

func Tokens added in v0.13.0

func Tokens() (map[string]string, error)

Tokens reads the desktop app's Local Storage LevelDB and returns a map of team ID to xoxc token. Returns ErrNotSignedIn if no localConfig_v2 entry with any team token is found.

The LevelDB is copied to a temp dir first (like the Cookies DB) so the live profile isn't locked or mutated while Slack is running.

Types

type Workspace

type Workspace struct {
	Name   string
	Domain string // subdomain under .slack.com
	TeamID string
}

Workspace is one signed-in workspace from the Slack desktop app.

func Workspaces

func Workspaces() ([]Workspace, error)

Workspaces reads and parses the desktop app's signed-in workspace list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL