Twitter embeds in a newsletter

Hi,

Has anyone tried the new Twitter embeds as they are not working for me? Updated to the latest ghost version and tried a few times but I still get a text (instead of Twitter card) in the email newsletter.

Thank you.

Tried… Same here!

Hey @sgyurov & @inoryum — are you self-hosting Ghost?

If so you’ll need to update your config: Configuration - Adapt your publication to suit your needs

2 Likes

Hi Kym, yes I’m using self-hosted Ghost. Updated today from 4.25.0 to 4.29.0

Hi @Kym,

I am using self-hosted ghost within docker-container.

& thanks for the info

Works like a charm! Thank you Kym :slight_smile:

For reference, you need to register for developer access, create a new project and new app and you will then get access to the bearer token. Add this to you config.production.json, restart ghost you are good to go.

More info here:

3 Likes

Glad to hear it. Moving thread to Developer Help category so other self-hosters and developers can find this answer too :)

1 Like

I am running into the very same issue. Could somebody maybe help me out, and point me to a guide on how to change Ghost’s config and add the Bearer Tokens?

Much appreciated!

I described it above in details or it’s not clear ?

Well, I do not know how to change or update Ghost‘s config, and I do not find any information regarding that in your post.

Right, you need to edit config.production.json (make a copy of the file just in case) and add the Twitter integration at the very end, I’ll add a larger block to get an idea of what it looks like:

  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/YOUR_SITE/content"
  },
  **"twitter": {
    "privateReadOnlyToken": "YOUR_TWITTER_API_BEARER_TOKEN"
  }**
}

Once you do that you need to restart ghost (ghost restart).

No one’s asked for my comment but here it is anyway, a friendly reminder: you’re telling him “you need to edit config.production.json”. But I think he just told you “I do not know how to change or update Ghost‘s config”.
All too often helpful people just assume everyone knows what terminal is or how to ssh and all that. I sure didn’t when I started trying to tweak ghost.

2 Likes

I am thankful for your comment, because you hit bull’s eye with it.

Although I am self-hosting Ghost, I only have very basic knowledge of Terminal commands. I know how to ssh to update Ghost, but I have no idea how to make a copy of config.production.json, edit it, and add the Twitter integration to it. I do not know how to access it. Throughout the years I am using Ghost, I never came across such a situation.

Maybe my comments were not precise enough. But I am looking for a step-by-step guide on how to access the config.production.json, how to copy it, how to edit it, how to safe it, etc.

Well, I just assumed you have basic Linux skills since you are running self-hosted Ghost?

You need to go to where you run your ghost from, modify the file using vi, nano or another command-line editor, make the changes I pasted above, save and then restart ghost.

Well, I am learning that through self-hosting Ghost.

I managed to edit the config and the Twitter embeds are now displayed within the newsletter, so thank you for that.

But they are not displayed in the web version. Any idea what the issue could be?