Preview: the PushFleet API isn't live yet. Join the waitlist
Credentials
PushFleet verifies credentials when you upload them by minting a real token with Apple or Google, so a bad key fails right away instead of on your first send. Credentials are write-only: once saved, the secret parts are never returned. Needs credentials: write.
POST /v1/credentials/apns
Send the .p8 file’s contents with its Key ID, your Team ID and the app’s Bundle ID. Apple shows where to find each.
await fleet.credentials.uploadApns({
key: readFileSync("AuthKey_8XK2.p8", "utf8"),
key_id: "8XK2ABCD12",
team_id: "4QX7M2ABCD",
bundle_id: "com.acme.storefront",
});fleet.credentials.upload_apns(
key=open("AuthKey_8XK2.p8").read(),
key_id="8XK2ABCD12",
team_id="4QX7M2ABCD",
bundle_id="com.acme.storefront",
)fleet.Credentials.UploadApns(ctx, pushfleet.CredentialsUploadApnsParams{
Key: pushfleet.ReadFile("AuthKey_8XK2.p8"),
KeyID: "8XK2ABCD12",
TeamID: "4QX7M2ABCD",
BundleID: "com.acme.storefront",
})fleet
.credentials()
.upload_apns()
.key(std::fs::read_to_string("AuthKey_8XK2.p8")?)
.key_id("8XK2ABCD12")
.team_id("4QX7M2ABCD")
.bundle_id("com.acme.storefront")
.await?;fleet.credentials.upload_apns(
key: File.read("AuthKey_8XK2.p8"),
key_id: "8XK2ABCD12",
team_id: "4QX7M2ABCD",
bundle_id: "com.acme.storefront"
)curl https://api.pushfleet.com/v1/credentials/apns \
-H "Authorization: Bearer $PUSHFLEET_SECRET_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile key AuthKey_8XK2.p8 '{key: $key, key_id: "8XK2ABCD12", team_id: "4QX7M2ABCD", bundle_id: "com.acme.storefront"}')"Firebase
Section titled “Firebase”POST /v1/credentials/fcm
Send the service account JSON as an object. Android shows how to create it.
await fleet.credentials.uploadFcm({
service_account: JSON.parse(readFileSync("service-account.json", "utf8")),
});fleet.credentials.upload_fcm(
service_account=json.load(open("service-account.json")),
)fleet.Credentials.UploadFcm(ctx, pushfleet.CredentialsUploadFcmParams{
ServiceAccount: pushfleet.ReadJSON("service-account.json"),
})fleet
.credentials()
.upload_fcm()
.service_account(serde_json::from_str(&std::fs::read_to_string("service-account.json")?)?)
.await?;fleet.credentials.upload_fcm(
service_account: JSON.parse(File.read("service-account.json"))
)curl https://api.pushfleet.com/v1/credentials/fcm \
-H "Authorization: Bearer $PUSHFLEET_SECRET_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -n --slurpfile service_account service-account.json '{service_account: $service_account[0]}')"Uploading again replaces the credential for that environment.