Skip to content

Trying to use API but blocked by CORS policy #197

Closed Answered by FlorianKoerner
MarianaK96 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MarianaK96

You don't have to fetch the images. Just put the URL in the src attribute of your img element.

function Avatar() {
    return <img src="https://avatars.dicebear.com/api/identicon/mariana.svg" />;
}

export default Avatar;

Alternatively, you can install the library. Of course, this also works with yarn.

yarn install @dicebear/avatars @dicebear/avatars-identicon-sprites

Here's how you can use the library in React:
#155

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@MarianaK96
Comment options

@FlorianKoerner
Comment options

@MarianaK96
Comment options

@FlorianKoerner
Comment options

Answer selected by FlorianKoerner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants