First, you need to get your api key and authToken from the authorization server. Then, to render the whole social kit:
import { AmityUiKitProvider, AmityUiKitSocial } from '@amityco/ui-kit';
function MyApp() {
return (
<AmityUiKitProvider
apiKey={...}
authToken={...}
userId="myUserId"
displayName="myUserName"
>
<AmityUiKitSocial />
</AmityUiKitProvider>
);
}
import { PostTargetType } from '@amityco/js-sdk'
import { AmityUiKitProvider, AmityUiKitFeed } from '@amityco/ui-kit';
function UserFeedPage({ user, isMe }) {
return (
<AmityUiKitProvider
apiKey={...}
authToken={...}
userId="myUserId"
displayName="myUserName"
>
<AmityUiKitFeed
targetType={isMe ? PostTargetType.MyFeed : PostTargetType.UserFeed}
targetId={user.userId}
showPostCreator={isMe}
/>
</AmityUiKitProvider>
);
}