This API will be eventually removed (see GH comment)
You may be interested in using this or this instead.