How to use customized icon/images in UI Kit components to avoid egress?

Hi,
I’m using external images from flaticon in my Forge App. But it says as ‘egress’ though I only reference the image url.
Anyone knows how to use customized icon/images in UI Kit components to avoid egress?
Thanks,
YY1

1 Like

Hey @YY1,

If you’re using images hosted externally, then you need to declare the resource in your manifest.yml:

permissions:
  scopes: []
  external:
    images:
      - i.imgur.com

If the image is stored in your app resources, you won’t need to do this - for example:

import smallLogo from '../../resources/logo_small.png';

/* the rest of your index.jsx file here */

      return (
        <>
           <Image src={smallLogo} />
        </>

Please note though, there is currently a bug in forge, and when you’re tunnelling the local image (smallLogo in the example above) will show an egress error. If you go ahead and deploy and close the tunnel, it will display correctly.

If this answers your question, please mark it as the solution!

Let me know if you have further questions.

Cheers!
Mel

1 Like

Hi @mpaisley
As per the official document:

We’ve introduced several changes for the loading of images and media in Custom UI apps so that:

  1. Custom UI apps now allow-list the host product
  2. Atlassian-hosted avatars now load by default

Effectively, this means the following domains are now allowed by default:

  • images
    • *.wp.com
    • secure.gravatar.com
    • images.unsplash.com
    • api.media.atlassian.com
    • *.atl-paas.net
    • *.atlassian.net
  • media
    • *.atlassian.net

However, this doesn’t work in my App production environment now, resulting in no team avatars shown. Could you please help pass it to your developers and fix it ASAP?

Thanks,
YY1