Create a data fetching component that wraps a NerdGraph request like the following (currently only accessible in the Product schema, but to be released in some modified form later in the year).
mutation DeleteUserToken($userId: ID!, $tokenName: String!) {
nerdStorageVaultWriteSecret(
scope: ACTOR
scopeId: $userId
name: $tokenName
) {
status
}
}
UserSecretMutation
Save, delete, or update a user scoped secret.
Write Secret
//retrieve and use a stored secret
import { UserSecretMutation } from '@newrelic/nr1-community';
UserSecretMutation.mutate({
actionType: UserSecretMutation.ACTION_TYPE.WRITE_SECRET,
name: 'mysecret',
value: 'mysecretvalue'
});
Note: Behind the scenes, it populates the required scopeId using an nr1 UserQuery to retrieve the user Id.
Delete Secret
//retrieve and use a stored secret
import { UserSecretMutation } from '@newrelic/nr1-community';
UserSecretMutation.mutate({
actionType: UserSecretMutation.ACTION_TYPE.DELETE_SECRET,
name: 'mysecret'
});
Note: Behind the scenes, it populates the required scopeId using an nr1 UserQuery to retrieve the user Id.
Create a data fetching component that wraps a NerdGraph request like the following (currently only accessible in the Product schema, but to be released in some modified form later in the year).
Write Secret
Delete Secret
UserSecretMutation
Save, delete, or update a user scoped secret.
Write Secret
Note: Behind the scenes, it populates the required
scopeId
using annr1
UserQuery to retrieve the user Id.Delete Secret
Note: Behind the scenes, it populates the required
scopeId
using annr1
UserQuery to retrieve the user Id.Props