Skip to content

Commit

Permalink
docs: add with-typescript example
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed May 22, 2021
1 parent 9dd2daa commit 5c7f396
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/with-typescript/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as prismic from '@prismicio/client'

const endpoint = prismic.getEndpoint('my-repo')
const client = prismic.createClient(endpoint)

const homepage = await client.getByUID('page', 'home')
console.log(homepage)
// => The `page` document with a UID of `home`
81 changes: 81 additions & 0 deletions examples/with-typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions examples/with-typescript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dependencies": {
"@prismicio/client": "^5.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
}
}

0 comments on commit 5c7f396

Please sign in to comment.