Skip to content

Client does not support bearer token authentication #147

Open

Description

@jwtracy

Couple issues here.

  1. README example has NewClient(ApiKey, ""). Code wants NewClient(AppID, ApiKey). The former is the only think that "worked" for me. This still doesn't return anything despite "successful" calls.
  2. The IntercomHTTPClient mechanics are misleading and do not match the API documentation's guidance to use Bearer token authorization. More below.
func (c IntercomHTTPClient) Get(url string, queryParams interface{}) ([]byte, error) {
	// Setup request
	req, _ := http.NewRequest("GET", *c.BaseURI+url, nil)
	req.SetBasicAuth(c.AppID, c.APIKey)
	req.Header.Add("Accept", "application/json")
	req.Header.Add("User-Agent", c.UserAgentHeader())
	addQueryParams(req, queryParams)
	if *c.Debug {
		fmt.Printf("%s %s\n", req.Method, req.URL)
	}

	// Do request ...
func (r *Request) SetBasicAuth(username, password string) {
	r.Header.Set("Authorization", "Basic "+basicAuth(username, password))
}

As it stands, it seems I need to implement my own intercom interfaces.HTTPClient interface to refactor Get, Post, Patch, Delete functions. Or get a change into this repo or some fork to properly use Bearer authorization. This repo doesn't seem maintainer but this does seem important for basic functionality. (Removing my star :( )

Activity

  1. uffejaeger commented on Jul 30, 2026

    @uffejaeger

    You’re right — this client still uses Basic auth, so it won’t work cleanly with current Intercom tokens without replacing the HTTP client.

    I’ve been working on a new Go client that uses a single bearer token:

    client, err := intercom.NewClient(token)

    It’s here: https://github.com/uffejaeger/intercom-go

    Full disclosure: it’s my project, not an official Intercom SDK. It’s still pre-v1, so I’d pin v0.2.1. If you try it and run into migration problems, open an issue and I’ll help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions