import { CivicProfile, Profile } from"@civic/profile";...// Query a user's profile using a wallet address, did or .sol domainconstprofile:Profile=awaitCivicProfile.get(user);
The profile result will contain the following data:
// The resolved public keyprofile.address// The resolved didprofile.did// A civic.me profile name, if availableprofile.name?.value// A civic.me profile image, if availableprofile.image?.url// A civic.me profile headline, if availableprofile.headline?.value// access identifiers like connected social accounts// [{ type: "github", value: "githubUsername" }]profile.identifiers
Getting a list of Civic Passes for the user
Returns a list of Civic passes owned by the user. This will include passes owned by the user across all chains supported by Civic.
import { CivicProfile, GatewayToken } from "@civic/profile";
// Query using a wallet address, did or SNS name
const profile = await CivicProfile.get("query");
const passOptions: PassOptions = {
includeExpired: true,
};
const passes: GatewayToken[] = await profile.getPasses(passOptions);