custom element for embedding Bluesky posts and feeds mary-ext.github.io/bluesky-embed
typescript npm bluesky atcute
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: upgrade to bluesky-client 0.5.x

Mary c1db1ba2 6209b800

+12 -17
+6 -6
lib/core.tsx
··· 1 1 import type { TrustedHTML } from '@intrnl/jsx-to-string'; 2 + 3 + import { BskyXRPC } from '@externdefs/bluesky-client'; 2 4 import type { 3 5 AppBskyEmbedExternal, 4 6 AppBskyEmbedImages, ··· 7 9 AppBskyFeedGetPostThread, 8 10 AppBskyFeedPost, 9 11 AppBskyGraphDefs, 10 - } from '@externdefs/bluesky-client/atp-schema'; 12 + } from '@externdefs/bluesky-client/lexicons'; 11 13 12 14 import './style.css'; 13 - 14 - import { Agent } from './utils/agent.ts'; 15 15 16 16 import { segment_richtext } from './utils/richtext/segmentize.ts'; 17 17 import type { Facet } from './utils/richtext/types.ts'; ··· 45 45 contextless: boolean, 46 46 service: string = 'https://public.api.bsky.app', 47 47 ): Promise<ThreadResponse> => { 48 - const agent = new Agent(service); 48 + const rpc = new BskyXRPC({ service }); 49 49 50 50 const [actor, rkey] = parse_src(src); 51 51 ··· 53 53 if (actor.startsWith('did:')) { 54 54 did = actor; 55 55 } else { 56 - const response = await agent.get('com.atproto.identity.resolveHandle', { 56 + const response = await rpc.get('com.atproto.identity.resolveHandle', { 57 57 params: { 58 58 handle: actor, 59 59 }, ··· 62 62 did = response.data.did; 63 63 } 64 64 65 - const response = await agent.get('app.bsky.feed.getPostThread', { 65 + const response = await rpc.get('app.bsky.feed.getPostThread', { 66 66 params: { 67 67 uri: `at://${did}/app.bsky.feed.post/${rkey}`, 68 68 parentHeight: !contextless ? 2 : 1,
-5
lib/utils/agent.ts
··· 1 - import type { Procedures, Queries } from '@externdefs/bluesky-client/atp-schema'; 2 - import { XRPC } from '@externdefs/bluesky-client/xrpc'; 3 - 4 - export type Agent = XRPC<Queries, Procedures>; 5 - export const Agent = XRPC<Queries, Procedures>;
+1 -1
lib/utils/richtext/types.ts
··· 1 - import type { AppBskyRichtextFacet } from '@externdefs/bluesky-client/atp-schema'; 1 + import type { AppBskyRichtextFacet } from '@externdefs/bluesky-client/lexicons'; 2 2 3 3 export type Facet = AppBskyRichtextFacet.Main; 4 4 export type LinkFeature = AppBskyRichtextFacet.Link;
+1 -1
package.json
··· 24 24 "./style.css": "./dist/style.css" 25 25 }, 26 26 "dependencies": { 27 - "@externdefs/bluesky-client": "^0.4.0" 27 + "@externdefs/bluesky-client": "^0.5.7" 28 28 }, 29 29 "devDependencies": { 30 30 "@babel/core": "^7.24.0",
+4 -4
pnpm-lock.yaml
··· 6 6 7 7 dependencies: 8 8 '@externdefs/bluesky-client': 9 - specifier: ^0.4.0 10 - version: 0.4.0 9 + specifier: ^0.5.7 10 + version: 0.5.7 11 11 12 12 devDependencies: 13 13 '@babel/core': ··· 471 471 dev: true 472 472 optional: true 473 473 474 - /@externdefs/bluesky-client@0.4.0: 475 - resolution: {integrity: sha512-PAeGem21mdmMvnWZOV1uruRM104nqhdPJkW7G3j4F9buwODc4sEGY/HrFJj4bwTs3CNcufz+H6niv1aOb2L2rQ==} 474 + /@externdefs/bluesky-client@0.5.7: 475 + resolution: {integrity: sha512-1OnJLh4LPgGfhPJxgKVTcOpzLTv/Po+5HSnhW3+94j6XnXW66Svhl2qr7d8ZqV9pf8lYUST3EeVXU6jcRKw7Sw==} 476 476 dev: false 477 477 478 478 /@intrnl/jsx-to-string@0.1.6(@babel/core@7.24.0):